[Seaside] Grease - get image directory
Boris Popov, DeepCove Labs
boris at deepcovelabs.com
Wed Mar 14 12:12:28 UTC 2012
I had to do something similar in VisualWorks, I doubt there will be a portable version, but you can certainly go via GRPlatform and implement removal of leading filename components to end up with a relative path for your resources, say,
String streamContents:
[:ws |
| components |
components := filename components.
(components last: components size - root)
do: [:comp | ws nextPutAll: comp]
separatedBy: [ws nextPut: $/]]
-Boris
-----Original Message-----
From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of Francois Stephany
Sent: Wednesday, March 14, 2012 12:41 AM
To: seaside at lists.squeakfoundation.org
Subject: [Seaside] Grease - get image directory
Hi,
GRPlatform has two methods: filesIn:aPathString and directoriesIn:aPathString. They return the absolute paths of the contained files.
However I do not see any (portable) way to know the image directory.
I think it is sometimes needed, for example:
GRPlatform current directoriesIn: 'bootstrap'
(where bootstrap is a directory next to my Pharo image). Gives me all the absolute path of the directories lying in <image directory>/bootstrap
How can I get the relative path of these directories compared to the 'bootstrap' directory?
Cheers,
Francois
_______________________________________________
seaside mailing list
seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
More information about the seaside
mailing list