Rebol Talk Forum  |  REBOL Discussions  |  REBOL View  |  Topic: Copy files and text-list
Pages: [1] Print
Author Topic: Copy files and text-list  (Read 372 times)
Silvia
Newbie
*
Offline Offline

Posts: 1


View Profile
Copy files and text-list
« on: November 14, 2005, 09:25:30 AM »

Hi everybody  Smiley ,
I'm trying to create a little program that creates backups. Anyway, I have 2 troubles with this:
1. I created a "Browse" button where the user chooses what he wants to copy, once did this I want to display the chosen files in a text-list but I cannot understand how to do this,
2. When creating the backup I need to copy the selected files in a new directory automatically created named with the curent date/time (if possible  :huh: ), but I don't know how to copy files (any type of file) and create this directory.
Thank you very much,
Silvia

P.S.: Ah, I forgot to tell you, I'm working on Windows XP with REBOL/View 1.3.1.3.1
Logged
Sunanda
Full Member
***
Offline Offline

Posts: 100


View Profile
Copy files and text-list
« Reply #1 on: November 19, 2005, 05:21:27 AM »

The easiest way to copy a file (or perhaps the only way, unless you go platform-specific with Call) is to read it and then write it.

You may also need to create the destination folder.

Code:
if not exists? new-path [
  make-dir/deep new-path
  ]

file-contents: read/binary join old-path file-name
write/binary join new-path file-name file-contents
Logged
Pages: [1] Print 
Rebol Talk Forum  |  REBOL Discussions  |  REBOL View  |  Topic: Copy files and text-list
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 07, 2008, 11:32:07 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2233 Posts in 581 Topics by 1886 Members
Latest Member: antigopit

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc