O nás     Inzerce     KontaktSpolehlivé informace o IT již od roku 2011
Hledat
Nepřehlédněte: Nejlepší IT: Pozoruhodné IT produkty pro rok 2024 podruhé
Správa dokumentů
Digitální transformace
Informační systémy
Hlavní rubriky: Informační systémy, Mobilní technologie, Datová centra, Sítě, IT bezpečnost, Software, Hardware, Zkušenosti a názory, Speciály

Pozoruhodné IT produkty 2024 podruhé
E-knihy o IT zdarma
Manuál Linux
[Linux manuál]

link: vytvořte nový název souboru

Originální popis anglicky: link - make a new name for a file

Návod, kniha: Linux Programmer's Manual

STRUČNĚ

#include <unistd.h>
 
int link(const char *oldpath, const char *newpath);

POPIS / INSTRUKCE

link creates a new link (also known as a hard link) to an existing file.
 
If newpath exists it will not be overwritten.
 
This new name may be used exactly as the old one for any operation; both names refer to the same file (and so have the same permissions and ownership) and it is impossible to tell which name was the `original'.

NÁVRATOVÁ HODNOTA

On success, zero is returned. On error, -1 is returned, and errno is set appropriately.

CHYBY / ERRORY

EACCES
Write access to the directory containing newpath is denied, or search permission is denied for one of the directories in the path prefix of oldpath or newpath. (See also path_resolution(2).)
EEXIST
newpath already exists.
EFAULT
oldpath or newpath points outside your accessible address space.
EIO
An I/O error occurred.
ELOOP
Too many symbolic links were encountered in resolving oldpath or newpath.
EMLINK
The file referred to by oldpath already has the maximum number of links to it.
ENAMETOOLONG
oldpath or newpath was too long.
ENOENT
A directory component in oldpath or newpath does not exist or is a dangling symbolic link.
ENOMEM
Insufficient kernel memory was available.
ENOSPC
The device containing the file has no room for the new directory entry.
ENOTDIR
A component used as a directory in oldpath or newpath is not, in fact, a directory.
EPERM
oldpath is a directory.
EPERM
The filesystem containing oldpath and newpath does not support the creation of hard links.
EROFS
The file is on a read-only filesystem.
EXDEV
oldpath and newpath are not on the same filesystem.

NOTES

Hard links, as created by link, cannot span filesystems. Use symlink if this is required.

ODPOVÍDAJÍCÍ

SVr4, SVID, POSIX, BSD 4.3, X/OPEN. SVr4 documents additional ENOLINK and EMULTIHOP error conditions; POSIX.1 does not document ELOOP. X/OPEN does not document EFAULT, ENOMEM or EIO.

BUGS

On NFS file systems, the return code may be wrong in case the NFS server performs the link creation and dies before it can say so. Use stat(2) to find out if the link got created.

SOUVISEJÍCÍ

ln(1), open(2), path_resolution(2), rename(2), stat(2), symlink(2), unlink(2)
2004-06-23 Linux 2.6.7
©2011-2024 BusinessIT.cz, ISSN 1805-0522 | Názvy použité v textech mohou být ochrannými známkami příslušných vlastníků.
Provozovatel: Bispiral, s.r.o., kontakt: BusinessIT(at)Bispiral.com | Inzerce: Best Online Media, s.r.o., zuzana@online-media.cz
O vydavateli | Pravidla webu BusinessIT.cz a ochrana soukromí | Používáme účetní program Money S3 | pg(9274)