dir to a text file
[1/3] from: mechtn::tkweb::net at: 14-Oct-2001 0:12
Can anyone tell me how i could dir and save it in a text file with ONLY the file names
in that directory on seperate lines.. Or tell me if its possible and what i'd need to
use.. Thanks!
Koie Smith
[2/3] from: mechtn:tkweb at: 14-Oct-2001 1:12
Hey guys i finally came up with my very own first script.. its bits and
peices from other code but i got it working.. it makes all the files in a
dir lowercase and then writes all their names to a txt file. Next i've got
to somehow read that textfile for file names and include them as attachments
for email and my program will be all finished! Thanks for all your help!
Koie Smith
REBOL [Title: "Write Dir to Txt File"]
filepath: %/c/rebol/orders/
foreach file read change-dir filepath [
rename file lowercase file
]
foreach file load filepath [
if find/any file "*" [
print ["adding:" file]
write/append %test.txt lowercase file
write/append %test.txt " "
]
]
----- Original Message -----
From: "mechtn" <[mechtn--tkweb--net]>
To: <[rebol-list--rebol--com]>
Sent: Sunday, October 14, 2001 12:12 AM
Subject: [REBOL] dir to a text file
> Can anyone tell me how i could dir and save it in a text file with ONLY
the file names in that directory on seperate lines.. Or tell me if its
possible and what i'd need to use.. Thanks!
[3/3] from: greggirwin:mindspring at: 14-Oct-2001 10:28
Hi Koie,
<< it makes all the files in a dir lowercase and then writes all their names
to a txt file. Next i've got
to somehow read that textfile for file names >>
If you want to read a file that consists of separate lines, look at using
open with the /lines refinement. Also, consider using a native REBOL format.
You can read and write values other than text very easily in REBOL. Look at
the save command and some of the library examples.
--Gregg