[Vm-dev] File system interface (was: FilePlugin argument checking - primitiveFailed vs PrimErrBadArgument)

David T. Lewis lewis at mail.msen.com
Sun Mar 4 21:28:05 UTC 2018


On Sun, Mar 04, 2018 at 12:57:39PM -0800, tim Rowledge wrote:
> 
> > On 04-03-2018, at 12:36 PM, tim Rowledge <tim at rowledge.org> wrote:
> > 
> >> On 04-03-2018, at 12:09 PM, David T. Lewis <lewis at mail.msen.com> wrote:
> >> 
> >> Just as an example, file systems on Windows use a very different approach
> >> for keeping track of file access times. On Windows, it is creation time,
> >> last access time, and last write time, while on Unix (including OSX) it 
> >> is last access time, last modification time, and last status change time.
> > 
> > And on RISC OS it's only the last-modified time.
> > 
> > Platform spread is *hard*
> 
> Oh, and let's consider the problems that can be caused by invalid assumptions about how file systems etc work; for example the way that directory lookup for the root directory works.
> 
> For a start not all systems have a meaningful concept of 'a root'. Windows/DOS has all the separate disk letters, and something else for network connected storage. RISC OS can have many different filing systems connected each with differing rules! My 'favourite' annoyance was always that to fake similar behaviour to unix, RISC OS had to scan for all connected FS handlers (which couldn't be done very well programmatically) and finding out what directories might exist on a CD drive meant spinning up the blasted drive! Imagine the delay involved in that. Although one can complain a bit about the implementation decisions made by people, we are at fault for implementing a less than helpful file system widget that insists on querying far too many directories to no real purpose.
>

I think we are drifting a bit off topic here, but this makes me wonder where
one might look to find an example of a good abstraction layer for file
systems. We cannot be the first ever to have encountered this issue, so
what might be an example of an existing system that interfaces with file
systems through a small, well-designed set of functions?

At a high level, the FileMan package (http://wiki.squeak.org/squeak/6333 and
currently used in Cuis) might provide some inspiration, although of course
under the covers it still using the existing FilePlugin. But maybe if you
think of it from the point of view of designing a plugin that would do the
best possible job of supporting FileMan (the FileIOAccessor actually) across
a range of systems, it might lead to a good result. 

Dave
 


More information about the Vm-dev mailing list