annotate src/lib/file-copy.h @ 9191:b340ecb24469 HEAD

Fix VPATH build of RQUOTA support. Some rpcgen derive #include "..." paths from the infile argument. This will be off for VPATH builds, as the generated rquota_xdr.c code will look in $(srcdir), but we'll generate the rquota.h file in $(builddir). Play safe and copy rquota.x to $(builddir) first. This fixes the build on openSUSE 11.1.
author Matthias Andree <matthias.andree@gmx.de>
date Tue, 07 Jul 2009 21:01:36 +0200
parents e4eb71ae8e96
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6410
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 4406
diff changeset
1 #ifndef FILE_COPY_H
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 4406
diff changeset
2 #define FILE_COPY_H
4406
18c7c5215b53 Added file_copy().
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
18c7c5215b53 Added file_copy().
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 /* Copy file atomically. First try hardlinking, then fallback to creating
18c7c5215b53 Added file_copy().
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5 a temporary file (destpath.tmp) and rename()ing it over srcpath.
18c7c5215b53 Added file_copy().
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6 If the destination file already exists, it may or may not be overwritten,
18c7c5215b53 Added file_copy().
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7 so that shouldn't be relied on.
18c7c5215b53 Added file_copy().
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8
18c7c5215b53 Added file_copy().
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9 Returns -1 = error, 0 = source file not found, 1 = ok */
18c7c5215b53 Added file_copy().
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10 int file_copy(const char *srcpath, const char *destpath, bool try_hardlink);
18c7c5215b53 Added file_copy().
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11
18c7c5215b53 Added file_copy().
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12 #endif