On Sat, May 23, 2009 at 1:04 PM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
Pier (in 1.1.1 I think) has it's own Importer/Exporter. I don't know if it works on Gemstone, but if this is the case is really easy. I do this when move a pier site from one image to another.

Cheers,


I don't think it handles the "files" directory, there is a comment saying copy by hand. However with a bit of code you could zip it in squeak. Oddly Squeak doesn't handle the ability to compress a directory, so here is some code. I note the unixFileAttributes: is needed to set the directory member with the proper permissions, otherwise on unix or os-x it unzips a directory as rw-rw-rw-   obviously a problem, and a bug. 

addCompleteDirectory: aLocalURI

"adds a complete directory structure to the zip archive"

|directory slash dirLocalPath|
directory := FileDirectory on: aLocalURI.

"construct the directory name"
slash := directory slash.
dirLocalPath := directory localName, slash.

self addDirectoryDescend: directory relativePath: dirLocalPath. 

addDirectory: aFileName as: anotherFileName
| newMember |
newMember := self memberClass newFromDirectory: aFileName.
newMember unixFileAttributes: 8r040755.
self addMember: newMember.
newMember localFileName: anotherFileName.
^newMember

addDirectoryDescend: directory relativePath: dirLocalPath

|slash|

"self break."
slash := directory slash.

"add the files"

self addDirectory: directory pathName as: dirLocalPath. 

directory fileNames
do: [:fileName| 
   "self break."
   self addFile: directory pathName, slash, fileName 
    as: dirLocalPath, fileName
].

directory directoryNames
do: [:subDirName| self addDirectoryDescend: (directory directoryNamed: subDirName)
  relativePath: dirLocalPath, subDirName, slash.

].

--
===========================================================================
John M. McIntosh <johnmci@smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================