Skip to content

Commit

Permalink
Fix cCode in #createImageDirectory:
Browse files Browse the repository at this point in the history
  • Loading branch information
PalumboN committed Feb 7, 2022
1 parent e6b9e74 commit 5a8ca84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
25 changes: 11 additions & 14 deletions smalltalksrc/VMMaker/AbstractComposedImageAccess.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@ Class {
#category : #'VMMaker-ImageFormat'
}

{ #category : #translation }
AbstractComposedImageAccess class >> declareCVarsIn: aCCodeGenerator [

aCCodeGenerator
addHeaderFile:'<sys/stat.h> /* for e.g. mkdir */'

]

{ #category : #'file operations' }
AbstractComposedImageAccess >> createImageDirectory: imageFileName [

self cCode: [ self mkdir: imageFileName ]
inSmalltalk: [ imageFileName asFileReference ensureCreateDirectory ]

self
cCode: [ self mkdir: imageFileName _: 0777 ]
inSmalltalk: [ imageFileName asFileReference ensureCreateDirectory ]
]

{ #category : #'file primitives' }
Expand Down Expand Up @@ -146,14 +154,3 @@ AbstractComposedImageAccess >> segmentMetadataFile: segmentIndex inImage: imageF
^ self segmentFileName: segmentIndex withExtension: '.ston' inImage: imageFileName into: buffer bufferSize: 255.

]

{ #category : #'string manipulation' }
AbstractComposedImageAccess >> vmConcatPath: dirPath File: fileName [

| prefix fullPath |
self flag: #TODO. "REMOVE"
prefix := self stretch: dirPath cat: '/'.
fullPath := self stretch: prefix cat: fileName.
self free: prefix.
^ fullPath
]
2 changes: 1 addition & 1 deletion smalltalksrc/VMMaker/ComposedImageWriter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ ComposedImageWriter >> writeSTON: struct toFile: f [
fieldValue
ifNil: [ fieldHasNilValue := true ]
ifNotNil: [
fieldHasNilValue := false.
fieldHasNilValue := false.
self fprintf: f _: '\t#%s : %ld' _: fieldName _: fieldValue ]]
separatedBy: [ fieldHasNilValue ifFalse: [self fprintf: f _: ',\n'] ].

Expand Down

0 comments on commit 5a8ca84

Please sign in to comment.