[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

new open keywords?

People take my suggestions so literally, sometimes, it amazes me. Let me try
it again from the point you got confused. 

With the keyword for making a temp file, I don't care if it's _LSPM_ OUTPUT
or a file that just doesn't live in the dir or what. It's just a keen idea
to have a safe way to open files knowing they won't bash the old version until
they are complete. I want to save writing the explicit rename in my code
every time. This is almost always the desired behavior. On particularly
losing opsys's yes, you might not be able to do it. But I think allowing the
feature and letting it err where it can't work would still be helpful to the
many places (Twenex, ITS, ...) where something winning can be arranged.
By the way -- there are cases where you do want writeback even if partial.
Puff the Magic Dragon's statistics, for example, probably want to be saved
even if errors occur. There are other applications where partial info is
better than either no info or the old info ... I think they're pretty rare
tho' -- that's why it's odd that this is the default IO mode for output,
rather than an available but not default mode out of which better modes can
be created.

You're right about :DONT-CLOBBER. Checking at OPEN and at CLOSE time could
both be helpful. You might not want to waste your time doing the I/O if you
know in advance the file exists, and you don't want to lose if someone writes
the file while you are doing the same... On systems where it can't be done
100% reliably, you might as well opt for 99%. If the system code can't do
it, neither can the user code -- and you know if you don't provide the 
heuristic version, everyone's just gonna write their own -- and theirs will
probably not be as well though out as the one the system could provide by
default ... so might as well save them time, effort, and mistakes and do the
best you can on it...