Home | Libraries | People | FAQ | More |
Hard links the file to a new location on the same volume.
If you wish to make a temporary file whose contents are ready appear at a location and error out if a file entry is already there, use link() and if success, unlink() on the former location. If you wish to always overwrite the destination, use atomic_relink() instead.
On Windows, the destination directory cannot have any handle opened to
it with delete/rename privileges (
)
anywhere in the system. This is an operating system limitation.
file_flags::write
Be aware that on Windows AFIO operates exclusively in the NT kernel namespace,
NOT the Win32 namespace, and therefore paths you supply are converted
by
in NT kernel namespace
paths. afio::path
can convert an afio path
back to a Filesystem TS path for you, but note that this may not be the
path that was supplied originally. NT kernel namespace paths have a 32,767
character limit and an almost POSIX like lack of restrictions on naming
or historical behaviour quirks, but as a result AFIO does not support
DOS short names or any of the other historical Win32 filing system baggage.
normalise_path()
Related types: path_req
virtual void handle::link(const path_req & req)
Type |
Concept |
Name |
Description |
---|---|---|---|
const path_req & |
req |
The absolute or relative (in which case precondition specifies a directory) path to create a hard link at. |
#include <boost/afio/v2/afio.hpp>
Operating system | Race guarantees under a changing file system |
---|---|
FreeBSD | Race free up to the containing directory for both source and target. |
Linux, Windows | Race free for source if handle open, else up to the containing directory. Race free up to the target directory. |
OS X | No guarantees. |