X Tutup
Skip to content

Commit 1a66633

Browse files
author
Johan Brichau
authored
Merge pull request SeasideSt#169 from SeasideSt/temporaryfiles-gemstone
Change temporary file creation api
2 parents 933bc73 + 5ae43f8 commit 1a66633

File tree

36 files changed

+182
-48
lines changed

36 files changed

+182
-48
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
files
2+
newTemporaryFile
3+
"Create a new temporary file in the systems temp directory and answer its pathString.
4+
It is the users responsibility to delete or move the file, it will not be cleaned up automatically
5+
(unless the host system has a policy for it)."
6+
^ self subclassResponsibility
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
files
2+
newTemporaryFileNamed: aName
3+
"Create a new temporary file in the systems temp directory and answer its pathString.
4+
It is the users responsibility to delete or move the file, it will not be cleaned up automatically
5+
(unless the host system has a policy for it)."
6+
self subclassResponsibility

repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileReference.st

Lines changed: 0 additions & 8 deletions
This file was deleted.

repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileReferenceNamed..st

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
files
2+
deleteFile: aPathString
3+
4+
GsFile removeServerFile: aPathString
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
files
2+
newTemporaryFile
3+
4+
^ self newTemporaryFileNamed: UUID new greaseString
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
files
2+
newTemporaryFileNamed: aName
3+
4+
| fileName |
5+
fileName := GRPlatform current pathSeparator,'tmp', GRPlatform current pathSeparator, aName.
6+
(self fileExists: fileName) ifTrue: [ GRError new signal: 'A (temporary) file with name ', aName, ' already exists.' ].
7+
^ (GsFile openWriteOnServer: fileName) pathName
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
files
2+
newTemporaryFile
3+
4+
^ self newTemporaryFileNamed: UUID new greaseString
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
files
2+
newTemporaryFileNamed: aName
3+
4+
| newFile |
5+
newFile := FileLocator temp / aName.
6+
newFile exists ifTrue: [ GRError new signal: 'A (temporary) file with name ', aName, ' already exists.' ].
7+
^ newFile pathString

repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ newTemporaryFileReference
55
It is the users responsibility to delete or move the file,
66
it will not be cleaned up automatically (unless the host system
77
has a policy for it)."
8+
self
9+
greaseDeprecatedApi: 'GRPlatform>>newTemporaryFileReference'
10+
details: 'Use newTemporaryFile'.
811
^ self newTemporaryFileReferenceNamed: UUID new asString

0 commit comments

Comments
 (0)
X Tutup