On Jul 1, 2009, at 1:28 PM, 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
A related notion, but a tangent (and then returning to the above thread)... One thing I did in Java (in 2001) and Python (later) --and have been considering doing in my current smalltalk code base-- was to create "Accessors" to access relational DB's, directory based files, and memory-based 2d-tables in a generic fashion. An Accessor, as I defined it, looked a lot like a combo of a DB connection and results set. The file-based Accessors were opened on a directory as the DB, where the files were tables (and those could be read or written in several formats: CSV, tab-delimited, etc.), and subdirectories were treated like tables of Blobs; another variant allowed an accessor to be opened on a directory as if it were bound to a specific table, and so the directory looked like a table of Blobs. Obviously, any level of complexity, and "auto" handling of file types is possible. (And I am not describing what I did well, there was symmetry and a recursive nature... and I'm too lazy to look and detail it right now; instead my goal is just to kick some ideas out.) Obviously the Accessors allowed me to ignore the data source. I keep puzzling that I have not encountered this type of thing elsewhere. And back to the main topic here... aren't URL's fairly well generalized? Are they not the right way to fully generalize locations? -cam