Alternative directory/file classes?

Masashi UMEZAWA masashi.umezawa at gmail.com
Mon Mar 12 14:28:48 UTC 2007


Hi, Bert,

> Cross-platform file support has been a real pain in the past, mostly
> because users usually only develop on one platform and unconsciously
> use platform-dependent strings for filenames. I've been working with
> the URI package lately (http://www.squeaksource.com/URI.html) which
> is a real pleasure because it just does the Right Thing when taking
> your code from one platform to the next.
>

What is bad about file:// URI is that it could contain drive letter in
Windows. I think it would easily break portability. So I just prefer
using relative portable path representation in FileMan.

In FileMan, the code like this works in all platforms.
'./test/hello.txt' fileContents: 'world'.

If you use absolute path (without drive letter), FileMan automatically
detects the current drive letter. So,
'/tmp' asDirectoryEntry files.

still works in all platforms. (though it may be a little extreme).

Regards,
-- 
[:masashi | ^umezawa]



More information about the Squeak-dev mailing list