When I was in Sweden last fall, I remember having a brief conversation with someone who'd written a resolver that loads classes or modules from a tar or zip file (the details are a little hazy).
Does that sound familiar to anyone here? If so, do you have any code you might be willing to share?
Bill
I've done one of those. I don't know if I still have any code lying around though; that was a long time ago when I still was att Roxen...
On Wed, Jun 20, 2012 at 09:35:02PM +0000, Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum wrote:
I've done one of those. I don't know if I still have any code lying around though; that was a long time ago when I still was att Roxen...
zip or tar? i'd be interested in a module that can exctract zip files in memory.
greetings, martin.
either, the bit I'm interested in is figuring out how to get the master to load classes or modules from an archive as though it were a directory on the pike_*_ path.
I've got a class that can modify and extract data from a ZIP file; it's based on code from someone else with some of my own extra seasoning. Looking at it, I can see a few minor changes that might make it more useful for in-memory work (adding support for adding files and directories from a Filesystem.Base object, etc).
I think it could be made into a subclass of Filesystem.Base without a lot of trouble.
Anyhow, here it is:
http://hg.welliver.org/fins/src/0a2c14930c9c/lib/Tools.pmod/Zip.pike
Feel free to send me any updates that might be useful; if it gets to be more full-featured, I'll commit it to the core.
Bill
On Jun 20, 2012, at 11:22 PM, Martin Bähr wrote:
On Wed, Jun 20, 2012 at 09:35:02PM +0000, Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum wrote:
I've done one of those. I don't know if I still have any code lying around though; that was a long time ago when I still was att Roxen...
zip or tar? i'd be interested in a module that can exctract zip files in memory.
greetings, martin.
On Wed, Jun 20, 2012 at 11:36:00PM -0400, H. William Welliver III wrote:
either, the bit I'm interested in is figuring out how to get the master to load classes or modules from an archive as though it were a directory on the pike_*_ path.
you may want to take a look at sTeam, it loads pike classes from a mysql database. it doesn't load modules that way though.
unfortunately the sTeam websites have been taken down. i have the code and i can send it to you but you can also find it in public debian archives. i am planning to publish what i have but i want to first find out why it was taken down. to busy for that now...
I've got a class that can modify and extract data from a ZIP file;
modify? as in add files to it? or can it only replace files already in there without being able to change the index?
it's based on code from someone else with some of my own extra seasoning. Looking at it, I can see a few minor changes that might make it more useful for in-memory work (adding support for adding files and directories from a Filesystem.Base object, etc).
that would be great. i am interested in supporting zip-file uploads and also potentially download, but for download tar is ok too because most archive extracters can handle tar these days.
no hurry though, i won't be working on this anytime soon.
greetings, martin.
you may want to take a look at sTeam, it loads pike classes from a mysql database. it doesn't load modules that way though.
unfortunately the sTeam websites have been taken down. i have the code and i can send it to you but you can also find it in public debian archives. i am planning to publish what i have but i want to first find out why it was taken down. to busy for that now…
I imagine that some modifications were made to the master; there is a function that is basically a wrapper to Stdio.read_file(), but with a bunch of extra logic. My guess is that's the place to start tracing back from.
I've got a class that can modify and extract data from a ZIP file;
modify? as in add files to it? or can it only replace files already in there without being able to change the index?
Yes, it should be able to add files, though I really only use it for atomic zipping and unzipping.
it's based on code from someone else with some of my own extra seasoning. Looking at it, I can see a few minor changes that might make it more useful for in-memory work (adding support for adding files and directories from a Filesystem.Base object, etc).
that would be great. i am interested in supporting zip-file uploads and also potentially download, but for download tar is ok too because most archive extracters can handle tar these days.
Should be possible to do that without too much effort.
no hurry though, i won't be working on this anytime soon.
greetings, martin.
:)
Bill
On Wed, Jun 20, 2012 at 11:36:00PM -0400, H. William Welliver III wrote:
either, the bit I'm interested in is figuring out how to get the master to load classes or modules from an archive as though it were a directory on the pike_*_ path.
actually, sTeam doesn't do it that way. to get an instance of a class it tracks the instances with the objects that represent the source, so i'd do: OBJ("/some/path/source.pike")->get_instance()->foo(); to call foo in source.pike.
to manipulate the master would actually be interesting, because it would allow more of sTeam to move into the database.
if you want to look at the code, i found an older downloadable archive here: http://sourceforge.net/projects/opensteam/files/open-sTeam%20server/steam-2....
greetings, martin.
pike-devel@lists.lysator.liu.se