Filename.st
changeset 1859 7f6040320daf
parent 1614 4e1a64b19247
child 1862 e8f44f10f1ab
--- a/Filename.st	Fri Nov 01 20:38:10 1996 +0100
+++ b/Filename.st	Fri Nov 01 20:39:35 1996 +0100
@@ -17,7 +17,7 @@
 	category:'System-Support'
 !
 
-!Filename  class methodsFor:'documentation'!
+!Filename class methodsFor:'documentation'!
 
 copyright
 "
@@ -202,7 +202,7 @@
 "
 ! !
 
-!Filename  class methodsFor:'instance creation'!
+!Filename class methodsFor:'instance creation'!
 
 currentDirectory
     "return a filename for the current directory"
@@ -425,7 +425,7 @@
     "Modified: 7.3.1996 / 14:53:10 / cg"
 ! !
 
-!Filename  class methodsFor:'queries'!
+!Filename class methodsFor:'queries'!
 
 components:aString
     "separate the pathName given by aString into 
@@ -1092,21 +1092,23 @@
 
     info := OperatingSystem infoOf:nameString.
     info isNil ifTrue:[
-	info := OperatingSystem linkInfoOf:nameString.
-	info isNil ifTrue:[
-	    ^ nil
-	]
+        info := OperatingSystem linkInfoOf:nameString.
+        info isNil ifTrue:[
+            ^ nil
+        ]
     ].
     dates := IdentityDictionary new.
-    dates at:#modified put:(info at:#modified).
-    dates at:#accessed put:(info at:#accessed).
-    dates at:#statusChanged put:(info at:#statusChanged).
+    dates at:#modified put:(info modified).
+    dates at:#accessed put:(info accessed).
+    dates at:#statusChanged put:(info statusChanged).
     ^ dates
 
     "
      Filename currentDirectory dates
      '../regression' asFilename dates
     "
+
+    "Modified: 1.11.1996 / 20:19:24 / cg"
 !
 
 fileSize
@@ -1116,7 +1118,9 @@
 
     info := self info.
     info isNil ifTrue:[^ nil].
-    ^ info at:#size
+    ^ info size
+
+    "Modified: 1.11.1996 / 20:24:43 / cg"
 !
 
 fileType
@@ -1216,34 +1220,34 @@
 !
 
 info
-    "return the files info; that is a collection of file attributes,
-     (actually a dictionary) where the keys are #type, #uid, #gid, #size etc.
-     The actual amount and detail returned may depend on the OS used.
-     On unix, if you ask for the info of a symbolic link, the target
-     files info is returned. (see also: #linkInfo)
+    "return some object filled with the files info;
+     the info (for which corresponding access methods are understood by
+     the returned object) is:
+
+         type  - a symbol giving the files fileType
+         mode  - numeric access mode 
+         uid   - owners user id
+         gid   - owners group id
+         size  - files size
+         id    - files number (i.e. inode number)
+         accessed      - last access time (as osTime-stamp)
+         modified      - last modification time (as osTime-stamp)
+         statusChanged - last staus change (as osTime-stamp)
 
-     On unix, the contents is:
-	id            -> the inode number (integer)
-	uid           -> the numeric user id of the files owner
-	gid           -> the numeric group id of the files owner
-	statusChanged -> the absoluteTime when the files status changed last
-			 (i.e. protection change, owner change etc.)
-	accessed      -> the absoluteTime when the file was last accessed
-	modified      -> the absoluteTime when the file was last modified
-	size          -> the size (in bytes) of the file
-	type          -> the files type (#regular, #directory, #characterSpecial)
-	mode          -> the files access protection bits (rwxrwxrwx mask).
+     Some of the fields may be returned as nil on systems which do not provide
+     all of the information.
+     The minimum returned info (i.e. on all OS's) will consist of at least:
+        modified
+        size
+        type
 
-     The minimum returned info (i.e. on all OS's) will consist of at least:
-	modified
-	size
-	type
-
-     Some OS's (VMS) may return more info.
-
-     Dont expect things like uid/gid/mode to be there; write your application
-     to either handle the cases where info-entries are not present,
+     Dont expect things like uid/gid/mode to be non-nil; write your application
+     to either handle nil values,
      or (better) use one of isXXXX query methods. (Be prepared for DOS ...)
+     (i.e. instead of:
+        someFilename type == #directory
+      use
+        someFIlename isDirectory
     "
 
     ^ OperatingSystem infoOf:nameString
@@ -1256,6 +1260,8 @@
      'source/Point.st' asFilename linkInfo 
      '../../libbasic/Point.st' asFilename info 
     "
+
+    "Modified: 1.11.1996 / 20:22:40 / cg"
 !
 
 linkInfo
@@ -2044,8 +2050,8 @@
     "Modified: 3.7.1996 / 10:49:58 / cg"
 ! !
 
-!Filename  class methodsFor:'documentation'!
+!Filename class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.69 1996-07-26 17:14:33 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.70 1996-11-01 19:39:35 cg Exp $'
 ! !