[Pharo-project] [squeak-dev] Accessing external resources in a cross-platform way

Stéphane Ducasse stephane.ducasse at inria.fr
Thu Feb 3 09:18:31 CET 2011


Hernan

I'm documenting and reorganizing and writing more tests for FS.
I contacted colin several times but got no feedback. The version that we will integrate in Pharo is 
available at: 
	PharoTaskForces
	if you want to integrate/publish your code there, then you are welcomed.
We will do several rounds, probably integrate dale gemstone fixes, deprecate and change some api
like workingDirectory returning a path and calling it workingDirectoryPath
and push FS in Pharo. Of course, people may probably complain but we will do it.

Stef

On Feb 3, 2011, at 1:01 AM, Hernán Morales Durand wrote:

> I've just implemented an initial release on top of FileSystem and
> ProcessWrapper (it uses some bit of Grease too). This is how it works
> in Windows:
> 
> ( FSLocator sysEnvBinaries / 'notepad.exe' ) resolve	"
> C:\WINDOWS\system32\notepad.exe "
> ( FSLocator sysEnvBinaries / 'X264VFW.DLL' ) resolve	"
> C:\WINDOWS\system32\X264VFW.DLL "
> ( FSLocator userBinaries / 'excel.exe' ) resolve		" C:\Archivos de
> programa\Microsoft Office\OFFICE11\EXCEL.EXE "
> ( FSLocator userBinaries / 'firefox.exe' ) resolve		" C:\Archivos de
> programa\Mozilla Firefox\firefox.exe"
> 
> So #sysEnvBinaries search in the OS PATH environment variable
> locations (which is usually pretty fast) and #userBinaries in the
> "program files" locations (it could be slow depending the amount of
> entries). It's only tested under Windows, IIRC user binaries in Unix
> are inside "/usr/local/bin" but you may tweak it to other locations, I
> have no access to a Unix or MacOS. Feel free to suggest or add any
> enhacements you like.
> Cheers,
> 
> Hernán
> 
> 2011/1/28 Colin Putney <colin at wiresong.com>:
>> On Fri, Jan 28, 2011 at 9:17 AM, Hernán Morales Durand
>> <hernan.morales at gmail.com> wrote:
>>> Thanks David,
>>> 
>>> I've seen FileSystem package http://www.wiresong.ca/filesystem/
>>> it seems related in some way too
>> 
>> Yes, FileSystem does attempt to provide a cross-platform way to
>> resolve paths that are system-dependent. It doesn't include a way to
>> search for executables, although that's a good feature idea. As David,
>> mentioned you probably want to get the value of the PATH environment
>> variable, and use that for your search. That will handle cross-host
>> differences as well as cross-platform issues.
>> 
>> Colin
>> 
>> 
> <Fsextensions-hfm.2.mcz>





More information about the Pharo-project mailing list