On Wed, Jun 30, 2010 at 10:29 AM, Richard Hainsworth <rich...@rusrating.ru> wrote: > Would it make sense to define $*FS as the implied local file system, and > thus that a bare 'open' is sugar for > my $fh = $*FS.open('/path/to/directory/filename', :r); > > This then means that there is an implicit > $*FS.connect(); > that makes the local system available to the program. > > I wonder whether this would also be a way of unifying the program interface > for difference Operating Systems, in that a program running on a *nix > machine would have $*FS of type IO::Filesystem::POSIX, while $*FS for a > Windows machine would have type IO::Filesystem::Windows, etc. > > Then it would be possible, as Aaron has suggested to have > my $remote-fs = IO::Filesystem::Google.connect(%args); > my $fh = $remote-fs.open($path-or-url, :r); > > and then treat $fh as specified elsewhere. > > Morover, it would then be possible to do > $*FS = $remote-fs; > > I would propose that this sort of flexibility would be useful for programs > that are embedded in other virtual environments, such as browser plugins, or > programs intended to run on thin clients that do not have their own > filesystems. >
I like this idea. It's flexible and extendable but has sane defaults. Leon