--- a/Filename.st Wed Jul 03 10:50:24 1996 +0200
+++ b/Filename.st Wed Jul 03 10:54:16 1996 +0200
@@ -1596,13 +1596,13 @@
"
'mak' asFilename filenameCompletion
- 'Make' asFilename filenameCompletion
+ 'Make' asFilename filenameCompletion
'Makef' asFilename filenameCompletion;yourself
'/u' asFilename filenameCompletion
'../../libpr' asFilename inspect filenameCompletion
"
- "Modified: 29.2.1996 / 20:28:36 / cg"
+ "Modified: 3.7.1996 / 10:53:51 / cg"
!
filenameCompletionIn:aDirectory
@@ -1840,34 +1840,39 @@
"return an array consisting of my prefix and suffix.
The suffix is the namepart after the final period character,
the prefix everything before, except for the period.
+ The directory name part is stripped off (i.e. the returned prefix
+ will consist of the files basename only.)
(on some systems, the suffix-character may be different from a period).
For example, foo.bar.baz has a prefix of 'foo.bar' and a suffix of '.baz'.
-
- Notice: there is currently no known system which uses other than
- the period character as suffixCharacter."
+ See also: #withoutSuffix and #withSuffix
+ Notice:
+ there is currently no known system which uses other than
+ the period character as suffixCharacter."
|nm idx|
nm := self baseName.
idx := nm lastIndexOf:(self class suffixSeparator).
idx == 0 ifTrue:[
- ^ Array with:nm with:''
+ ^ Array with:nm with:''
].
^ Array
- with:(nm copyTo:idx-1)
- with:(nm copyFrom:idx+1)
+ with:(nm copyTo:idx-1)
+ with:(nm copyFrom:idx+1)
"
'abc.st' asFilename prefixAndSuffix
'abc' asFilename prefixAndSuffix
'a.b.c' asFilename prefixAndSuffix
+ '/foo/bar.c/baz.c' asFilename prefixAndSuffix
|parts|
parts := 'Object.st' asFilename prefixAndSuffix.
- ((parts at:1) , '.o') asFilename
+ ((parts at:1) , '.o') asFilename
"
"Modified: 7.9.1995 / 11:15:42 / claus"
+ "Modified: 3.7.1996 / 10:53:10 / cg"
!
withSuffix:aSuffix
@@ -1876,9 +1881,9 @@
otherwise, the new suffix simply appended to the name."
^ self class named:
- (self withoutSuffix name
- , self class suffixSeparator asString
- , aSuffix asString)
+ (self withoutSuffix name
+ , self class suffixSeparator asString
+ , aSuffix asString)
"
'abc.st' asFilename withSuffix:'o'
@@ -1886,10 +1891,11 @@
'a.b.c' asFilename withSuffix:'o'
'/foo/bar/baz.st' asFilename withSuffix:'c'
'/foo/bar/baz.c' asFilename withSuffix:'st'
+ '/foo/bar.c/baz.c' asFilename withSuffix:'st'
"
"Modified: 7.9.1995 / 11:15:42 / claus"
- "Modified: 29.2.1996 / 20:50:03 / cg"
+ "Modified: 3.7.1996 / 10:50:56 / cg"
!
withoutSuffix
@@ -1921,5 +1927,5 @@
!Filename class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.60 1996-07-03 08:50:24 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Filename.st,v 1.61 1996-07-03 08:54:16 cg Exp $'
! !