SYNOPSIS
#include <unistd.h>
int symlink(const char *name1, const char *name2);
DESCRIPTION
The
The file to which the symbolic points is used when an
If the file named by name2 does not exist, it is created. The permission mode of name2 is 777.
PARAMETERS
- name1
-
Is the file that the symbolic link is to point to.
- name2
-
Is the name of symbolic link to be created.
RETURN VALUES
On success,
- EACCES
-
Search permission is denied on a component of name2.
- EEXIST
-
The file referenced by name2 already exists.
- EFAULT
-
name1 or name2 is an invalid pointer.
- EINVAL
-
name1 or name2 contains an invalid character.
- ENAMETOOLONG
-
The length of name1 or name2 exceeds PATH_MAX, or a path name component is longer than NAME_MAX.
- ENOENT
-
name1 or name2 points to an empty string.
- ENOSPC
-
The new symbolic link cannot be created because no space is left on the file system which is to contain the link.
- ENOTDIR
-
A component of name2 is not a directory.
- EROFS
-
The new symbolic link would reside on a read-only file system.
CONFORMANCE
UNIX 98, with exceptions.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
Symbolic links are implemented in two different ways:
The older implementation was only supported on 2016/2019/2022/2025 on local NTFS-5 file systems.
On all other supported platforms,
The newer implmentation works on 10/2016/2019/11/2022/2025 and only when the calling user account can assert the SeCreateSymbolicLinkPrivilege privilege. By default this privilige is held only by administrators but may be assigned to any user using standard windows tools or the PTC MKS Toolkit priv. When it cannot be asserted,
In this latter case, the underlying Win32 API CreateSymbolicLink() needs to know of the target of the symbolic link is a file or directory. No action is needed if the target name1 exists as the type is derived from the existing target file. It is legal to create a symbolic link that points to a file or directory that has yet to be created. In that case
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
_NutConf() ,chown() ,lchown() ,link() ,lstat() ,open() ,readlink() ,stat() ,unlink()
PTC MKS Toolkit 10.5 Documentation Build 40.