Functions operating on a list of files return the number of files successfully operated upon.
Changes the permissions of a list of files. The first element of the list must be the numerical mode. If this is a number, it must be in octal, e.g., 0644
. Files can be designated by name and by handle.
Changes the owner and group of a list of files. The first two elements of the list must be the numerical user ID and group ID. If either is –1, that property is not changed. Files can be designated by name and by handle.
,
newfileCreates a new filename linked to the old file.
Like stat, but if the last component of the filename is a symbolic link, stats the link instead of the file it links to. file can be an expression evaluating to a filename, or _
to refer to the last file test -l
operation or lstat call.
,
perm ]Creates a directory with permissions specified by perm and modified by the current umask. If perm is a number, it must be an octal number. Default value for perm is 0777.
See also umask in page 60.
Returns the name of the file pointed to by the symbolic link designated by expr.
,
newnameChanges the name of a file.
Deletes the directory if it is empty.
Returns a 13-element list with file information. file can be a filehandle, an expression evaluating to a filename, or _
to refer to the last file test operation or stat call. Returns an empty list if the stat fails.
Use the standard module File::stat
for by-name access to the elements of the list:
Index | Name | Description |
---|---|---|
0 | dev | Device code. |
1 | ino | Inode number. |
2 | mode | Type and access flags. |
3 | nlink | Number of hard links. |
4 | uid | User ID of owner. |
5 | gid | Group ID of owner. |
6 | rdev | Device type. |
7 | size | Size, in bytes. |
8 | atime | Timestamp of last access. |
9 | mtime | Timestamp of last modification. |
10 | ctime | Timestamp of last status change. |
11 | blksize | File system block size. |
12 | blocks | Size, in blocks. |
,
newfileCreates a new filename symbolically linked to the old filename.
,
sizeTruncates file to size. file may be a filename or a filehandle.
Deletes a list of files.
Changes the access and modification times. The first two elements of the list must be the numerical access and modification times. When both elements are undef, the current time is used.
The inode change time will be set to the current time.