www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Reading a File That is Being Written To From Phobos

reply dsimcha <dsimcha yahoo.com> writes:
It seems that Phobos won't allow opening a file that is being written to by
another program.  I understand that this is unsafe behavior.  However, for my
purposes, I don't care and want to do it anyhow.  (My purposes are that I have
a program periodically dumping data to a file and every once in a while I want
another program to just parse the results and print a summary to the screen).
 I usually receive a message like:

std.stream.OpenException: Cannot open or create file <filename>

This occurs even when I can open the file in vi, etc.  Is this a conscious
design decision?  If not, is it a legitimate bug?
Jun 15 2009
parent Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
dsimcha wrote:
 It seems that Phobos won't allow opening a file that is being written to by
 another program.  I understand that this is unsafe behavior.  However, for my
 purposes, I don't care and want to do it anyhow.  (My purposes are that I have
 a program periodically dumping data to a file and every once in a while I want
 another program to just parse the results and print a summary to the screen).
  I usually receive a message like:
 
 std.stream.OpenException: Cannot open or create file <filename>
 
 This occurs even when I can open the file in vi, etc.  Is this a conscious
 design decision?  If not, is it a legitimate bug?
http://d.puremagic.com/issues/show_bug.cgi?id=2429 ?
Jun 15 2009