# HG changeset patch # User Stefan Vogel # Date 1109159514 -3600 # Node ID a134e378d5f5004892f66457b495da4ee754501d # Parent 3e7429854c5527f75fac55c50360b177e7dd7a60 #nullFilename diff -r 3e7429854c55 -r a134e378d5f5 PCFilename.st --- a/PCFilename.st Wed Feb 23 12:49:35 2005 +0100 +++ b/PCFilename.st Wed Feb 23 12:51:54 2005 +0100 @@ -97,15 +97,8 @@ |pid nr nameString| - (self ~~ ConcreteClass) ifTrue:[ - ^ ConcreteClass newTemporaryIn:aDirectoryPrefix - ]. - - "/ although the above allows things to be redefined in concrete classes, - "/ the following should work on all systems ... - NextTempFilenameIndex isNil ifTrue:[ - NextTempFilenameIndex := 1. + NextTempFilenameIndex := 1. ]. pid := OperatingSystem getProcessId printString. @@ -113,12 +106,12 @@ nr := NextTempFilenameIndex printString. nr := nr copyLast:(3 min:nr size). nameString := (self tempFileNameTemplate) - bindWith:pid - with:nr. + bindWith:pid + with:nr. NextTempFilenameIndex := NextTempFilenameIndex + 1. (aDirectoryPrefix isNil or:[aDirectoryPrefix asString isEmpty]) ifFalse:[ - ^ aDirectoryPrefix asFilename construct:nameString + ^ aDirectoryPrefix asFilename construct:nameString ]. ^ self named:nameString @@ -231,6 +224,20 @@ ^ false ! +nullFilename + "Return the OS dependent filename for the data sink, or nil if there is none" + + ^ 'nul:' +! + +parentDirectoryName + "return the name used for the parent directory. + This is '..' for unix and dos-like systems. + (there may be more in the future." + + ^ '..' +! + separator "return the file/directory separator." @@ -724,5 +731,5 @@ !PCFilename class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/PCFilename.st,v 1.27 2004-12-15 10:31:29 penk Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/PCFilename.st,v 1.28 2005-02-23 11:51:54 stefan Exp $' ! !