Well actually in Sophie we used URI http://en.wikipedia.org/wiki/URI *hint* all that code is MIT By using relative URI then asking for the read or readwrite stream later we could build URI constructs that referred to disk, to a server in the cloud, to memory. Oh and let's not forget the Squeak file primitive logic is *so* crippled that asking if a file exists either means opening the file, or iterating over N files in your directory to confirm it exists. Again for Sophie we added a FFI call to see if the operating system would tell us if the file existed. So I'd suggest one thinks about reusing the URI logic PS we also went to great pains to ensure the URI got encoded correctly so unicode aware file systems actually would end up with the proper characters. On 1-Jul-09, at 10:28 AM, Stephen Pair wrote:
On Wed, Jul 1, 2009 at 9:42 AM, Stéphane Ducasse <stephane.ducasse@inria.fr
wrote: Hi guys
we should really consider to have an alternate (may be building on / rewriting part of RIO) but FileDirectory sucks.
I have a file
FileDirectory default
and now I want to get two levels up.
Well after 20 min looking around I could not find a way. I'm probably too stupid for squeak arcane logic.
Smalltalk deserves a better library for file. What a crap this stuff.
Stef
LoL...how many years did it take you to come to this conclusion? Anyway, if anyone does take up the job of rewriting the file system interface, I have a suggestion based on some recent stuff we've done here at work. We wanted a way of running test cases for code that uses the file system, but we didn't want to actually use the file system (for speed...when you run many thousands of test cases, hitting the disk can really slow things down). We wanted to substitute an in memory simulation of a file system. We had to go to great lengths to accomplish this (in VisualWorks). It would be really cool if things like filenames and directories didn't make assumptions about the file system with which they are used (so that you could have filenames for in memory file systems, or filenames for other file systems that one might connect with in ways other than the built in local file system primitives).
- Stephen _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- = = = ======================================================================== John M. McIntosh <johnmci@smalltalkconsulting.com> Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com = = = ========================================================================