Cross-platform path specification (was RE: Access directory relatively)

Alan Kay Alan.Kay at squeakland.org
Mon Aug 5 22:41:49 UTC 2002


What about using backslash "\"?

Cheers,

Alan

-------

At 10:30 PM +0200 8/5/02, Andreas Raab wrote:
>  > >Questions:
>>  > * Does this work properly cross-platform?
>>
>>  It should, as long you don´t hardcode a pathNameDelimiter
>
>That actually reminds me of something - I had to use relative paths
>lately in cross-platform ways and the current way of [not] dealing with
>it really sucks. So here's a proposal for introducing FileDirectory>>,
>for referencing either files or directories. E.g., in order to get a
>directory 'foo/bar/baz' you'd write:
>
>dir := FileDirectory default, 'foo', 'bar', 'baz'.
>
>To get the file 'foo/bar/baz/mumble.file' you would say:
>
>file := FileDirectory default, 'foo', 'bar', 'baz', 'mumble.file'.
>
>The returned file would be closed so you'd have to open it through:
>
>file open: #readOnly.
>file open: #readWrite.
>
>Feelings?
>
>BTW, I had considered using '/' but it looks kinda ugly to write
>	FileDirectory default / 'foo' / 'bar' / 'baz'.
>comma is already a concatenation operator and makes the cross-platform
>aspect a little clearer.
>
>Cheers,
>   - Andreas


-- 



More information about the Squeak-dev mailing list