Your initial intuition is right. The intention is to provide some abstraction 
of the file system/OS. The goal is not to provide a complete abstraction but 
one that is complete enough to support common operations. If the abstraction is 
leaking somewhere it's either a bug or there is a good reason why the code 
doesn't use PAL (for example, the operation is platform/Ruby specific and has 
no simple abstraction). So if you have a good use-case that doesn't work right 
now feel free to file a bug here: 
http://ironruby.codeplex.com/WorkItem/AdvancedList.aspx and we'll fix it.

Tomas

From: ironruby-core-boun...@rubyforge.org 
[mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Nathan Stults
Sent: Tuesday, October 13, 2009 11:19 PM
To: ironruby-core@rubyforge.org
Subject: [Ironruby-core] PlatformAdaptationLayer - scope

What is the correct way to view the PlatformAdaptationLayer? My initial 
assumption was that it was IronRuby's abstraction of the file system (and 
environment variables), but in digging deeper I see that the Dir builtin is 
calling into the file system in many places using the System.IO classes 
directly. My next thought was that the PAL must then be purely a hosting 
construct that exists to allow hosts to provide alternative dependency 
resolution, but this doesn't seem to quite fit either, since the Glob 
implementation, which is also a part of Dir.cs, *does* go through the PAL, so 
it isn't just used for dependency resolution. Is the long term plan to make all 
file system manipulation go through the PAL, and if not, could someone shed 
some light on how the PAL is intended to be used / understood? I'm attempting 
to do something similar to the ZipArchive stuff in Chiron, that would allow zip 
files to be put into the application path of non-silverlight apps, or used for 
the Gem_Path, etc (for easy deployment of IronRuby, gems and other static 
library code) but I'm concerned that if a gem or some other ruby code tries to 
scan the file system for convention based dependencies (does this even happen?) 
the PAL may get bypassed entirely under certain circumstances. I'm not familiar 
enough with the ruby libraries to know if this should even be a concern in 
practice, but the zip-as-virtual-file-system metaphor looks like it will have 
some holes at least in theory.

Thanks,

Nathan

_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to