I had trouble with path names from windows. Rebol doesn�t appear to
understand them natively.

Rebol changes the current directory to the directory of the script that is
run.

Relative paths on a command line are relative to the directory from which
Rebol is executed. This path is in system/script/parent/path.

I wrote the following function to convert argument strings in windows format
to file paths in Rebol.

cvt_path: func [
    "Convert windows path to Rebol path"
    :path [string!] {Path to convert}
    ] [
    replace/all path "\" "/"
    either find path ":"
    [   ; Path has ':' -- make full path
        replace path ":" "" path: join "/" path
    ] [ ; Path is relative to script parent path
        path: join to-string system/script/parent/path path
    ]
    to-file path
]

Is there a better way to handle this?

Thanks,

Garold (Gary) L. Johnson
DYNAMIC Alternatives <http://www.dynalt.com/>
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>


Reply via email to