[squeak-dev] [BUG] ERROR: File not in Directory: [...] while trying to create a SAR-archive on Windows

gettimothy gettimothy at zoho.com
Thu Jan 22 22:23:29 UTC 2015


W/o testing it, I noticed that you have a forward slash in 





FileDirectory slash , '*.*'') do: [ :f | self

  extractMember: f].' as: 'install/preamble'.  <---------------------should this be FileDirectory slash? 

 

cheers




---- On Thu, 22 Jan 2015 15:22:25 -0500 Tim Oesterreich <tim.oesterreich at student.hpi.de> wrote ---- 

Hello all, 
 
|package folder|
 
“Name of the Monticello-package that should be archived”
package := 'SWAProject'.
“Name of the resources folder in Contents/Resources/”
folder := 'SWA-Resources'.
 
zip := ZipArchive new.
mczStream := RWBinaryOrTextStream on: (String new: 10000).
workingCopy := MCWorkingCopy forPackage: (MCPackage new name: package).
version := workingCopy newVersion fileOutOn: mczStream.
(zip addString: mczStream contents as: package, '.mcz') desiredCompressionLevel: 0.
zip addTree: Smalltalk imagePath match: [:e | e fullName startsWith:
    Smalltalk imagePath , FileDirectory slash , folder].
zip addString:  'self fileInMonticelloZipVersionNamed: ''' , package, '.mcz''.
(self membersMatching: ''' , folder , FileDirectory slash , '*.*'') do: [ :f | self
    extractMember: f].' as: 'install/preamble'.
zip writeToFileNamed: package , '.sar'.
 
This code should create a SAR-Archive from a Monticello-Package including all resources in the specified folder
However it throws the error “File not in Directory: SWA-Resources#” on a Windows-System, while working fine on a Mac.
It seems like there is an issue with the handling of platform-dependent directory seperators  (\ on Windows, / on UNIX). 
 
Best
-Tim
 
 





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20150122/ec42b12c/attachment-0001.htm


More information about the Squeak-dev mailing list