Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

hardlink(1) [suse man page]

hardlink(1)						      General Commands Manual						       hardlink(1)

NAME
hardlink - Link multiple copies of a file SYNOPSIS
hardlink [option]... [directory|file]... DESCRIPTION
hardlink is a tool which replaces copies of a file with hardlinks, therefore saving space. OPTIONS
-h or --help print quick usage details to the screen. -v or --verbose More verbose output. If specified once, every hardlinked file is displayed, if specified twice, it also shows every comparison. -n or --dry-run Do not act, just print what would happen -f or --respect-name Only try to link files with the same (basename). -p or --ignore-mode Link/compare files even if their mode is different. This may be a bit unpredictable. -o or --ignore-owner Link/compare files even if their owner (user and group) is different. It is not predictable -t or --ignore-time Link/compare files even if their time of modification is different. This will retain the newest timestamp, unless -m or -M is given. -m or --maximize Try to maximize the link count of the files. -M or --minimize Try to minimize the link count of the files. -x or --exclude A regular expression which excludes files from being compared and linked. -i or --include A regular expression to include files. If the option --exclude has been given, this option re-includes files which would otherwise be excluded. If the option is used without --exclude, only files matched by the pattern are included. ARGUMENTS
hardlink takes one or more directories which will be searched for files to be linked. BUGS
hardlink assumes that the trees it operates on do not change during operation. If a tree does change, the result is undefined and poten- tially dangerous. For example, if a regular file is replaced by a device, hardlink may start reading from the device. If a component of a path is replaced by a symbolic link or file permissions change, security may be compromised. Do not run hardlink on a changing tree or on a tree controlled by another user. AUTHOR
The program hardlink and this manpage have been written by Julian Andres Klode, and are licensed under the MIT license. See the code of hardlink for further information. 0.2.0 2012-02-28 hardlink(1)

Check Out this Related Man Page

EIO_LINK(3)								 1							       EIO_LINK(3)

eio_link - Create a hardlink for file

SYNOPSIS
resource eio_link (string $path, string $new_path, [int $pri = EIO_PRI_DEFAULT], [callable $callback = NULL], [mixed $data = NULL]) DESCRIPTION
eio_link(3) creates a hardlink $new_path for a file specified by $path. PARAMETERS
o $path - Source file path. o $new_path - Target file path. o $pri -The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL. If NULL passed, $pri internally is set to EIO_PRI_DEFAULT. o $callback -$callback function is called when the request is done. It should match the following prototype: void callback(mixed $data, int $result[, resource $req]); o $data -is custom data passed to the request. o $result -request-specific result value; basically, the value returned by corresponding system call. o $req -is optional request resource which can be used with functions like eio_get_last_error(3) o $data - Arbitrary variable passed to $callback. RETURN VALUES
EXAMPLES
Example #1 eio_link(3) example <?php $filename = dirname(__FILE__)."/symlink.dat"; touch($filename); $link = dirname(__FILE__)."/symlink.link"; $hardlink = dirname(__FILE__)."/hardlink.link"; function my_hardlink_cb($data, $result) { global $link, $filename; var_dump(file_exists($data) && !is_link($data)); @unlink($data); eio_symlink($filename, $link, EIO_PRI_DEFAULT, "my_symlink_cb", $link); } function my_symlink_cb($data, $result) { global $link, $filename; var_dump(file_exists($data) && is_link($data)); if (!eio_readlink($data, EIO_PRI_DEFAULT, "my_readlink_cb", NULL)) { @unlink($link); @unlink($filename); } } function my_readlink_cb($data, $result) { global $filename, $link; var_dump($result); @unlink($link); @unlink($filename); } eio_link($filename, $hardlink, EIO_PRI_DEFAULT, "my_hardlink_cb", $hardlink); eio_event_loop(); ?> The above example will output something similar to: bool(true) bool(true) string(%d) "%ssymlink.dat" SEE ALSO eio_symlink. PHP Documentation Group EIO_LINK(3)
Man Page