[Pharo-project] oldFileNamed
Forgetting the wish for new File accessing implementations for a moment, is there a reason why the current StandardFileStream >> oldFileNamed: (and oldFileFullyNamed) is implemented: ^(self isAFileNamed: fileName) ifTrue: [self new open: fileName forWrite: true] ifFalse: [(FileDoesNotExistException fileName: fileName) signal] instead of : ^(self new open: fullName forWrite: true) ifNil: ["File does not exist..." (FileDoesNotExistException fileName: fullName) signal] ? Feels abit silly to open a file to see if it exists, then close it, then open it again before returning it... (It also causes an unneccessary rehash of StandardFileStream registry on success) Cheers, Henry
2009/7/3 Henrik Johansen <henrik.s.johansen@veloxit.no>:
Forgetting the wish for new File accessing implementations for a moment, is there a reason why the current StandardFileStream >> oldFileNamed: (and oldFileFullyNamed) is implemented: ^(self isAFileNamed: fileName) ifTrue: [self new open: fileName forWrite: true] ifFalse: [(FileDoesNotExistException fileName: fileName) signal] instead of : ^(self new open: fullName forWrite: true) ifNil: ["File does not exist..." (FileDoesNotExistException fileName: fullName) signal]Â ? Feels abit silly to open a file to see if it exists, then close it, then open it again before returning it... (It also causes an unneccessary rehash of StandardFileStream registry on success)
Please submit an issue in the tracker and provides a changeset or a mcz with your change. I will have a look at it. Thank you for your report -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
http://code.google.com/p/pharo/issues/detail?id=921 On Jul 3, 2009, at 2:39 00PM, Damien Cassou wrote:
2009/7/3 Henrik Johansen <henrik.s.johansen@veloxit.no>:
Forgetting the wish for new File accessing implementations for a moment, is there a reason why the current StandardFileStream >> oldFileNamed: (and oldFileFullyNamed) is implemented: ^(self isAFileNamed: fileName) ifTrue: [self new open: fileName forWrite: true] ifFalse: [(FileDoesNotExistException fileName: fileName) signal] instead of : ^(self new open: fullName forWrite: true) ifNil: ["File does not exist..." (FileDoesNotExistException fileName: fullName) signal] ? Feels abit silly to open a file to see if it exists, then close it, then open it again before returning it... (It also causes an unneccessary rehash of StandardFileStream registry on success)
Please submit an issue in the tracker and provides a changeset or a mcz with your change. I will have a look at it.
Thank you for your report
-- Damien Cassou http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
participants (2)
-
Damien Cassou -
Henrik Johansen