|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-f6f2c534ea
|
GIS Library - function to recursively copy a directory. More...
#include <stdio.h>#include <errno.h>#include <string.h>#include <grass/gis.h>#include <fcntl.h>#include <unistd.h>#include <dirent.h>#include <sys/types.h>#include <sys/stat.h>
Go to the source code of this file.
Functions | |
| int | G_recursive_copy (const char *src, const char *dst) |
| Copy recursively source directory to destination directory. | |
GIS Library - function to recursively copy a directory.
Extracted from general/manage/lib/do_copy.c
(C) 2008-2015 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file copy_dir.c.
Copy recursively source directory to destination directory.
RULE:
This rule is designed according to general/manage/lib/copy.sh.
POSSIBLE CASES:
* if src is a file: * if dst does not exist: * copy src to dst RULE 1 * if dst is a file: * delete dst and copy src to dst RULE 2 * if dst is a directory: * try recursive_copy(src, dst/src) RULE 3 * if src is a directory: * if dst does not exist: * copy src to dst RULE 1 * if dst is a file: * delete dst and copy src to dst RULE 2 * if dst is a directory: * try RULE 4 * for i in `ls src` * do * recursive_copy(src/$i, dst/$i) * done *
| src | source directory |
| dst | destination directory |
Definition at line 69 of file copy_dir.c.
References AMI_STREAM< T >::AMI_STREAM(), UntypedStream::buf, close, closedir(), G_lstat(), G_mkdir(), G_recursive_copy(), GPATH_MAX, open, opendir(), read, readdir(), S_ISDIR, and write.
Referenced by G_recursive_copy(), I_signatures_copy(), M_do_copy(), and V1_close_nat().