FileMode.Out

Chris Miller chris at dprogramming.com
Sun Jul 23 23:17:07 PDT 2006


I open a File with FileMode.Out and I can't read the file from other  
programs while the file is open. Why is the file sharing set this way? It  
has been annoying me all the way from my early days of D.

I often open a file at program startup and write log information to it;  
sometimes the program runs 24 hours a day. What good is a log file if I  
can never read it?

Please set file sharing to always share read access. It should be 2 simple  
fixes to stream.d in function parseMode.

Also, there could be a way to extend File to allow specifying file  
sharing. Since not every environment offers this functionality, it could  
just be a request, and there could also be another function to call that  
returns true if sharing is definitely available, or false if it is not or  
cannot be determined.

A lot of times I just go back to C FILE*s because D's streams just feel  
icky.


Oh yeah, I forgot, opening for write causes sharing write access. This is  
really bizarre. It should always share read and should never share write  
(unless there's a way to change it per File).


I'm going to be pretty mad if this isn't fixed for 1.0 - especially the  
sharing write.



More information about the Digitalmars-d mailing list