I am trying to create a path named "/foo/bar" in Racket on a windows 
machine.  build-path produces "/foo\\bar" and build-path/convention-type 
does not seem to work:

     > (path->string (build-path "/" "foo" "bar")) 
    "/foo\\bar" ; I am running on a Windows machine, so this is expected
    > (path->string (build-path/convention-type 'windows "/" "foo" "bar"))
    "/foo\\bar"
    > (path->string (build-path/convention-type 'unix "/" "foo" "bar"))
    ; build-path/convention-type: specified convention incompatible with 
string path element
    ;   path element: "/"
    ;   convention: 'unix
    > (path->string (build-path/convention-type 'unix "/foo" "bar"))
    ; build-path/convention-type: specified convention incompatible with 
string path element
    ;   path element: "/foo"
    ;   convention: 'unix

It seems that I cannot specify the root path, "/", when the convention type 
is set to 'unix.  Technically, the error is correct, as "/" is not a valid 
directory name, but I am not sure what to replace it with. The empty string 
does not work either.   The unix convention type seems to be more strict 
than the windows one:

    > (path->string (build-path/convention-type 'windows "./foo/" "bar"))
    "./foo/bar"
    > (path->string (build-path/convention-type 'unix "./foo/" "bar"))
    ; build-path/convention-type: specified convention incompatible with 
string path element
    ;   path element: "./foo/"
    ;   convention: 'unix

Is this a bug, or I am missing something?

Alex.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to