--- a/Filename.st Mon Jul 22 23:43:23 1996 +0200
+++ b/Filename.st Mon Jul 22 23:56:34 1996 +0200
@@ -1126,7 +1126,7 @@
On non-unix systems, this may return an empty string, not knowning
about the contents."
- |stream typeString|
+ |stream buffer s n typeString suffix|
"/ since executing 'file' takes some time, do the most obvious
"/ ones here.
@@ -1135,6 +1135,27 @@
^ 'symbolic link to ' , (self linkInfo at:#path)
].
self isDirectory ifTrue:[^ 'directory'].
+ self isReadable ifFalse:[^ 'unreadable'].
+
+ buffer := String new:1024.
+ s := self readStream.
+ s notNil ifTrue:[
+ n := s nextBytes:buffer size into:buffer.
+ s close.
+ n == buffer size ifTrue:[
+ ((suffix := self suffix) = 'st'
+ or:[suffix = 'ST']) ifTrue:[
+ (buffer findString:'subclass:') ~~ 0 ifTrue:[
+ ^ 'smalltalk source'
+ ].
+ ].
+ self baseName = 'Makefile' ifTrue:[
+ (buffer startsWith:'#') ifTrue:[
+ ^ 'make rules'
+ ]
+ ]
+ ]
+ ].
typeString := ''.
stream := PipeStream readingFrom:('file ' , self pathName).
@@ -1160,7 +1181,7 @@
'bitmaps/SBrowser.xbm' asFilename fileType
"
- "Modified: 22.7.1996 / 21:41:44 / cg"
+ "Modified: 22.7.1996 / 21:53:26 / cg"
!
info
@@ -1995,5 +2016,5 @@
!Filename class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.66 1996-07-22 21:43:23 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.67 1996-07-22 21:56:34 cg Exp $'
! !