Boost logo

Boost :

Subject: Re: [boost] [modular boost] non-linked headers
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2013-12-02 21:36:13


On 3/12/2013 15:02, Quoth Beman Dawes:
> I'm missing something. Could you give an example of what you mean by "Most
> programs don't change files in place"? Hard links ensure that a change is
> always seen by both the entries because there is only one underlying file.
> I ran into that with Visual Studio when I tried symlinks and found that as
> a result Visual Studio failed to realize when a dependency had changed.

I don't know about "most", but it's not uncommon for editors designed to
work on very large files (or in defense against antivirus scanners, or
their own bugs) to write out a temporary file either elsewhere or beside
the target file, and then delete the original and rename the copy to
match the original.

This minimises the window in which the file does not contain valid
contents, and is typically as close as you can get in a
non-transactional filesystem to an atomic file replacement, since delete
and renames are near-instant compared to writes.

This helps to defend against data loss and against other software that
is monitoring the directory for files with particular filename patterns,
and often improves performance when editing very large files.

I'm not entirely sure how this interacts with symlinks -- whether it'll
just work or whether the editor would need to be symlink-aware.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk