[Pharo-project] [ VM ]Smalltalk getSystemAttribute:

Sean P. DeNigris sean at clipperadams.com
Tue Jan 3 10:45:30 EST 2012

Igor Stasenko wrote
> because you can always strip down unwanted information (just do regexp
> like '.app/Contents'),

Or with PetitParser:
	| vmPath bundleExtension bundlePathParser bundlePath |
	vmPath := OSProcess programName.
	bundleExtension := '.app' asParser.
	bundlePathParser := (bundleExtension negate star, bundleExtension) flatten.
	bundlePath := bundlePathParser parse: vmPath.
	^ FSFilesystem disk root resolve: bundlePath.

View this message in context: http://forum.world.st/VM-Smalltalk-getSystemAttribute-tp4122708p4257314.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

More information about the Pharo-dev mailing list