File/Directory handling problem

Started by Robert Wiggins on 23-Dec-2012/19:33:06-8:00
I,m new to Rebol and this is my first attempt to program with it. I would appreciate any help that someone can provide on the following: Rebol Console seems to tell me the file doesn't exist when it really does. I'm doing something wrong here but I can't seem to resolve it. Code and execution follows: REBOL/View 2.7.8.3.1 1-Jan-2011 Copyright 2000-2011 REBOL Technologies. All rights reserved. REBOL is a trademark of REBOL Technologies. WWW.REBOL.COM >> R E B O L [] == [] >> Probe Find %"/C/Users/Robert Wiggins/AppData/Roaming/Microsoft/CFSWW1 Over Flanders Fields/CFS3.xca" none == none >> what-dir == %/C/Users/Public/Rebol%20Utils/rebol/view/ >> list-dir
Addendum to last post: I'm runing Windows Vista Ultimate and my Rebol.exe has "Run as Administrator" defined so hopefully I'm not experiencing an "Auth" problem.
Did you try just using PROBE without FIND? I'm not on Windows, but FIND and PROBE FIND both give none as the result with a known file. PROBE by itself, however, does return the complete path to the file.
Hi Robert, You shouldn't use quotes in a file type. You can use either of these to refer to the file: to-file "/C/Users/Robert Wiggins/AppData/Roaming/Microsoft/CFSWW1 Over Flanders Fields/CFS3.xca" %/C/Users/Robert%20Wiggins/AppData/Roaming/Microsoft/CFSWW1%20Over%20Flanders%20Fields/CFS3.xca
Nick's suggestion of using "to-file" worked for me. Thanks for the response folks, it is appreciated. I have one more ? I want to copy a file from one location on a disk to another location. I'm not sure if I should be using "Read" and "Write" to do this. I just want to do a sort of backup of a file. Any recommendations?? Thanks
Hi Robert, You can do: write %backup.fil read %source.fil or, if it's a binary file: write/binary %backup.fil read/binary %source.fil
to my knowledge, you can use quotes to specify files with spaces. It's still a file! if the % is before. >> equal? %"/c/windows" %/c/windows == true >> equal? %"/c/program files (x86)/" to-rebol-file "c:\program files (x86)\" == true

Reply