Re: Why doesn't (open ... :if-exists) support :truncate?
- From: Kaz Kylheku <kkylheku@xxxxxxxxx>
- Date: Fri, 30 Nov 2007 10:14:49 -0800 (PST)
On Nov 29, 6:05 pm, "Steven M. Haflich" <s...@xxxxxxxxxxxx> wrote:
Have you considered :supersede ? It isn't exactly the same as :truncate
(on certain operating systems, or some processes have the file open) but
the usual behavior will be the same.
Even if other processes don't have the file open, the effect of
creating a new inode might be undesireable. You might be breaking a
hard link relationship.
Sometimes this is a good thing (it's basically doing copy-on-write),
sometimes it's not a good thing. I used to clone CVS repositories
using hard link farming. It was a good thing that the CVS server would
create a new object when re-writing a ,v history file, providing the
copy-on-write semantics needed to make the space-saving sharing look
invisible: commits in one copy of the repo were not seen in the other.
In other kinds situations, you may want the same object, for various
good reasons.
If there were a :TRUNCATING-OVERWRITE option, the set of possibilities
covered would be more complete.
Perhaps :NEW-VERSION could be mapped to doing a truncating overwrite
on a non-versioned filesystem. A new version means writing new data
within the same object; only in this case, the old version is lost. :)
There is that extra requirement to have :NEWEST as the version
component of the path, which is a minor annoyance.
.
- References:
- Why doesn't (open ... :if-exists) support :truncate?
- From: Richard M Kreuter
- Re: Why doesn't (open ... :if-exists) support :truncate?
- From: Steven M. Haflich
- Why doesn't (open ... :if-exists) support :truncate?
- Prev by Date: Re: Why doesn't (open ... :if-exists) support :truncate?
- Next by Date: Re: OT: "frgo" is not frog! WAS: Re: A simple debugging macro
- Previous by thread: Re: Why doesn't (open ... :if-exists) support :truncate?
- Next by thread: A simple debugging macro
- Index(es):