To answer my own question:
> Hi list,
>
> Can someone explain this?
> 2 files created, one in cwd, the other in user app support dir.
> The latter is not recognized by Meta_File:exists.
The problem was escaping the blank in the path name.
File class doesn't like
Platform.userAppSupportDir.escapeChar($ )
wheras unixCmd et al need the escaping (for the Mac path name) and,
third variant, pathMatch doesn't care if the space char is escaped or
not.
Although it appears slightly cumbersome to me to need different string
versions for the same path in a different context, I'm still happy
now, having found an explanation.
>
>
>
> (
> ~p1 = "testfile";
> // escape space char (mac path)
> ~p2 = Platform.userAppSupportDir.escapeChar($ ) +/+ ~p1;
> // create two empty files
> ("touch" + ~p1 + ~p2).systemCmd;
> )
>
> // line by line
> File.exists(~p1); // true
> File.exists(~p2); // false
>
> ~p1.pathMatch;
> ~p2.pathMatch; // showing up here
>
> // the difference:
> File.use(~p1, "r", { |f| f.dump }); // fileptr : RawPointer ...
> File.use(~p2, "r", { |f| f.dump }); // fileptr : nil
>
> // permissions look the same (to me)
> ("ls -l " ++ ~p1.dirname).unixCmd;
> ("ls -l " ++ ~p2.dirname).unixCmd;
>
>
>
> // clean up
> ("rm" + ~p1 + ~p2).systemCmd
>
_______________________________________________
sc-users mailing list
info (subscribe and unsubscribe):
http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880archive:
http://www.listarc.bham.ac.uk/marchives/sc-users/search:
http://www.listarc.bham.ac.uk/lists/sc-users/search/