[Seaside] file path abstraction

Julian Fitzell seaside@lists.squeakfoundation.org
Wed, 17 Jul 2002 14:25:26 -0700


Tim Rowledge wrote:
> Rob Whitfield <rob@customfun.com> is claimed by the authorities to have written:
> 
> 
>>Must I detect the OS and use system specific folder naming conventions or 
>>does squeak have a more generic abstraction that would work in both cases 
>>using a single representation?
> 
> You're making the very common mistake of treating strings as file names.
> 
> You need to do something like
> 	(FileDirectory default directoryNamed: 'data') readOnlyfileNamed:
> 'foo.bar'
> 
> Though to be honest even that is a terribly misuse of strings. Squeak
> doesn't actaully have anything approaching a decent file name related
> system as yet, so this has to do for now.
> 
> tim

There's also a class method on FileDirectory called something like 
pathSeparator that will return either $/ or $\ or $: or whatever as 
appropriate, if you do need it.

Julian

-- 
julian@beta4.com
Beta4 Productions (http://www.beta4.com)