Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: opening a file...

From: sanghabum:aol at: 7-Oct-2001 4:21

[mgkiourt--otenet--gr] writes:
> A file on the C directory can easily be opened with rebol e.g. > print read %frunlog.txt > How will I open a file located in a different directory, for example in my > briefcase?
print read %/c/my briefcase/frunlog.txt Note use of forward slashes where you (as I assume a windows user) would expect a colon or a backslash. Note also need for to escape a space. Other ways include: print read to-file "/c/my briefcase/frunlog.txt" ;; the quoted string allows an embedded space print read to-rebol-file "c:\my briefcase\frunlog.txt" ;; Uses undocumented to-rebol-file function to convert ;; from a windows file name to a rebol one ;; This code isn't so portable!! change-dir %/c/my briefcase print read %frunlog.txt ;; Changes directory. Useful if you ;; have several files to read or write. Hope that helps, Colin.