Filename.st
changeset 1 a27a279701f8
child 2 6526dde5f3ac
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Filename.st	Fri Jul 16 11:39:45 1993 +0200
@@ -0,0 +1,71 @@
+"
+ COPYRIGHT (c) 1992-93 by Claus Gittinger
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+
+Object subclass:#Filename
+         instanceVariableNames:'name'
+         classVariableNames:''
+         poolDictionaries:''
+         category:'ST-80 compatibility'!
+
+Filename comment:'
+
+COPYRIGHT (c) 1992-93 by Claus Gittinger
+             All Rights Reserved
+
+Filenames for ST-80 compatibility. Only the minimum is implemented
+here to make some PD programs happy - I dont know what else there
+is in ST-80.
+
+%W% %E%
+'!
+
+!Filename class methodsFor:'instance creation'!
+
+named:aString
+    ^ (self basicNew) name:aString
+! !
+
+!Filename methodsFor:'converting'!
+
+asString
+    ^ name
+!
+
+asFilename
+    ^ self
+! !
+
+!Filename methodsFor:'private accessing'!
+
+name:aString
+    name := aString
+! !
+
+!Filename methodsFor:'file access'!
+
+exists
+    "return true, if such a file exists"
+
+    ^ OperatingSystem isValidPath:name
+!
+
+fileIn
+    ^ (FileStream readonlyFileNamed:name) fileIn
+!
+
+readStream
+    ^ FileStream readonlyFileNamed:name
+!
+
+writeStream
+    ^ FileStream newFileNamed:name
+! !