X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
position: anInteger
^ stream position: anInteger
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
file library
files
contentsOfFile: aString binary: aBoolean
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
files
deleteFile: aPathString
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
directoriesIn: aPathString
"Answer a collection of absolute paths for all the directories (no files) in the directory given by aPathString
must not include directory names that start with ."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
ensureExistenceOfFolder: aString
"Create a folder named aString in the image directory."
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
file library
files
fileExists: aString
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
fileStreamOn: aString do: aBlock binary: aBoolean
self
greaseDeprecatedApi: 'GRPlatform>>#fileStreamOn:do:binary:'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
filesIn: aPathString
"Answer a collection of absolute paths for all the files (no directories) in the directory given by aPathString
must not include file names that start with ."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
localNameOf: aFilename
"Answer the local name of a file identified by an absolute file path.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
newTemporaryFileReference
"Create a new temporary file in the systems temp directory
and answer a reference to it.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
files
newTemporaryFileReferenceNamed: aName
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
pathSeparator
"Answer the path separator as a String, eg. '/' on Unix and '\' on Windows."
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
file library
files
readFileStreamOn: aString do: aBlock binary: aBoolean
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
write: aStringOrByteArray toFile: aFileNameString inFolder: aFolderString
"Write aStringOrByteArray to a file named aFileNameString in the folder aFolderString."
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
file library
files
writeFileStreamOn: aString do: aBlock binary: aBoolean
self subclassResponsibility
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
file library
files
contentsOfFile: aString binary: aBoolean
^ self readFileStreamOn: aString do: [ :stream | stream contents ] binary: aBoolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
files
deleteFile: aPathString
aPathString asFileReference delete
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
directoriesIn: aPathString
"Answer a collection of absolute paths for all the directories (no files) in the directory given by aPathString
must not include directory names that start with ."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
ensureExistenceOfFolder: aString
"creates a folder named aString in the image directory"
FileSystem disk ensureCreateDirectory: aString
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
file library
files
fileExists: aString
^ aString asFileReference exists
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
filesIn: aPathString
"Return a collection of absolute paths for all the files (no directories) in the directory given by aPathString
must not include file names that start with ."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
file library
files
localNameOf: aFilename
^ (FileSystem disk resolveString: aFilename) basename
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
file library
files
newTemporaryFileReference
"Create a new temporary file in the systems temp directory
and answer a reference to it.
It is the users responsibility to delete or move the file,
it will not be cleaned up automatically (unless the host system
has a policy for it)."
^ FileLocator temp / UUID new asString
^ self newTemporaryFileReferenceNamed: UUID new asString
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
files
newTemporaryFileReferenceNamed: aName
"Create a new temporary file in the systems temp directory
and answer a reference to it.
It is the users responsibility to delete or move the file,
it will not be cleaned up automatically (unless the host system
has a policy for it)."
^ FileLocator temp / aName
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
file library
files
pathSeparator
^ String with: FileSystem disk delimiter
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
readFileStreamOn: aString do: aBlock binary: aBoolean

^ aBoolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
write: aStringOrByteArray toFile: aFileNameString inFolder: aFolderString
"writes aStringOrByteArray to a file named aFilenameString in the folder aFolderString"
^ self
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
writeFileStreamOn: aString do: aBlock binary: aBoolean
^ aBoolean
ifTrue: [ aString asFileReference binaryWriteStreamDo: aBlock ]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
file library
deleteFile: aPathString
aPathString asFileReference delete
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ newTemporaryFileReference
It is the users responsibility to delete or move the file,
it will not be cleaned up automatically (unless the host system
has a policy for it)."
^ FileLocator temp / UUID new asString
^ self newTemporaryFileReferenceNamed: UUID new asString
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
file library
newTemporaryFileReferenceNamed: aName
"Create a new temporary file in the systems temp directory
and answer a reference to it.
It is the users responsibility to delete or move the file,
it will not be cleaned up automatically (unless the host system
has a policy for it)."
^ FileLocator temp / aName
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
file library
files
contentsOfFile: aString binary: aBoolean
^ self readFileStreamOn: aString do: [ :stream | stream contents ] binary: aBoolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
files
deleteFile: aPathString
aPathString asFileReference delete
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
directoriesIn: aPathString
"Answer a collection of absolute paths for all the directories (no files) in the directory given by aPathString
must not include directory names that start with ."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
ensureExistenceOfFolder: aString
"creates a folder named aString in the image directory"
FileSystem disk ensureCreateDirectory: aString
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
file library
files
fileExists: aString
^ aString asFileReference exists
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
filesIn: aPathString
"Return a collection of absolute paths for all the files (no directories) in the directory given by aPathString
must not include file names that start with ."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
file library
files
localNameOf: aFilename
^ (FileSystem disk resolveString: aFilename) basename
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
file library
files
newTemporaryFileReference
"Create a new temporary file in the systems temp directory
and answer a reference to it.
It is the users responsibility to delete or move the file,
it will not be cleaned up automatically (unless the host system
has a policy for it)."
^ FileLocator temp / UUID new asString
^ self newTemporaryFileReferenceNamed: UUID new asString
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
files
newTemporaryFileReferenceNamed: aName
"Create a new temporary file in the systems temp directory
and answer a reference to it.
It is the users responsibility to delete or move the file,
it will not be cleaned up automatically (unless the host system
has a policy for it)."
^ FileLocator temp / aName
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
file library
files
pathSeparator
^ String with: FileSystem disk delimiter
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
readFileStreamOn: aString do: aBlock binary: aBoolean

^ aBoolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
write: aStringOrByteArray toFile: aFileNameString inFolder: aFolderString
"writes aStringOrByteArray to a file named aFilenameString in the folder aFolderString"
^ self
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file library
files
writeFileStreamOn: aString do: aBlock binary: aBoolean
^ aBoolean
ifTrue: [ aString asFileReference binaryWriteStreamDo: aBlock ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tests-filestreams
tests-files
testFileExists
| theFileName |
self
Expand Down
X Tutup