[Pharo-project] readonly status conflict with reading
Hi john When I set on mac a file to readonly, I get nil when I do FileStream named: 'foo.txt' Stef
Stef, FWIW, the biggest problem I see with this is returning nil rather than raising an exception. With that omission corrected, there are various ways I could envision it working, probably centered on failing to open a writable stream, but if one asks for a read-only stream, there would be no need for an error. I don't too much care what the rules are, so long as the system enforces them consistently and tells me when I violate them. Attached is a partial view of what I have been doing as I find such things in my way. The goals are to provide entry points that my existing code expects and to (a path, not a destination) never fail silently. Bill ________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Stéphane Ducasse [stephane.ducasse@inria.fr] Sent: Saturday, October 09, 2010 2:39 AM To: Pharo Development Subject: [Pharo-project] readonly status conflict with reading Hi john When I set on mac a file to readonly, I get nil when I do FileStream named: 'foo.txt' Stef _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On Sat, 9 Oct 2010, Stéphane Ducasse wrote:
Hi john
When I set on mac a file to readonly, I get nil when I do FileStream named: 'foo.txt'
I guess that's #fileNamed:, not #named:. When you send that method, you're trying to open the file in read-write mode. If you just want to read from a file then use #readOnlyFileNamed:. Levente
Stef
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
participants (3)
-
Levente Uzonyi -
Schwab,Wilhelm K -
Stéphane Ducasse