1RFIO_RENAME(3)              Rfio Library Functions              RFIO_RENAME(3)
2
3
4

NAME

6       rfio_rename - rename a file or directory
7

SYNOPSIS

9       #include <sys/types.h>
10       #include "rfio_api.h"
11
12       int rfio_rename (const char *oldpath, const char *newpath)
13

DESCRIPTION

15       rfio_rename renames a file or directory.
16
17       oldpath  and  newpath must be of the same type, i.e. both regular files
18       or both directories.
19
20       If newpath exists already, it will be removed before the  rename  takes
21       place. If newpath is a directory, it must be empty.
22
23       When renaming a directory, newpath must not be a descendant of oldpath,
24       i.e.  newpath must not contain a path prefix that names oldpath.
25
26       Write permission is required on both parents. If oldpath  is  a  direcā€
27       tory,  write permission is required on it and if newpath is an existing
28       directory, write permission is also required on it.
29
30       If any of the parents has the sticky bit S_ISVTX set, either
31
32              the effective user ID of the requestor must match the  owner  ID
33              of the file or
34
35              the  effective  user ID of the requestor must match the owner ID
36              of the directory or
37
38              the file must be writable by the requestor or
39
40              the requestor must be super-user.
41

RETURN VALUE

43       This routine returns 0 if the operation was successful  or  -1  if  the
44       operation failed. In the latter case, serrno is set appropriately.
45

ERRORS

47       ENOENT       A component of oldpath prefix does not exist or oldpath or
48                    newpath is a null pathname.
49
50       EACCES       Search permission is denied on a  component  of  the  path
51                    prefixes  or write permission on the parent directories is
52                    denied or oldpath is a directory and write  permission  is
53                    denied on oldpath or newpath.
54
55       EFAULT       oldpath or newpath is a NULL pointer.
56
57       EEXIST       newpath is an existing directory and is not empty.
58
59       ENOTDIR      A  component  of  the  path prefixes is not a directory or
60                    oldpath is a directory and newpath is an existing  regular
61                    file.
62
63       EISDIR       newpath is a directory while oldpath is a regular file.
64
65       EINVAL       newpath is a descendant of oldpath.
66
67       ENAMETOOLONG The  length of oldpath or newpath exceeds CA_MAXPATHLEN or
68                    the length of a path component exceeds CA_MAXNAMELEN.
69
70       SENOSHOST    Host unknown.
71
72       SENOSSERV    Service unknown.
73
74       SECOMERR     Communication error.
75
76       ERFXHOST     Cross-host rename is not supported.
77

SEE ALSO

79       Castor_limits(4), rfio_chmod(3), rfio_unlink(3)
80

AUTHOR

82       LCG Grid Deployment Team
83
84
85
86LCG                      $Date: 2005/03/31 13:13:03 $           RFIO_RENAME(3)
Impressum