Sponsored Content
Top Forums UNIX for Advanced & Expert Users how to remove the files along with its link files Post 302330710 by Ramesh_srk on Thursday 2nd of July 2009 05:37:40 AM
Old 07-02-2009
Java how to remove the files along with its link files

How to remove the files along with its link files either hardlink or softlink?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Link files in unix

Can anyone say some ideas about using/creating link files (for ex., lrwxrwxrwx 1 bin bin 7 Jan 10 2001 bin -> usr/bin) in a shell script. (2 Replies)
Discussion started by: yuvasyntel
2 Replies

2. UNIX for Dummies Questions & Answers

Permissions on link files

Does any one now if you can change permissions on a linked file with out completely removing it and then relinking it? (2 Replies)
Discussion started by: moviestud80
2 Replies

3. UNIX for Dummies Questions & Answers

Link files....

How do you identify the type of a link in the output of the ls -l command? (1 Reply)
Discussion started by: Tom Bombadil
1 Replies

4. Shell Programming and Scripting

link files together

if I have 1000 files, named file1, file2, ... ,file1000. for each one, I want to append a line, for example "this is the end of file#". then, I want to link them all together. how can I do that by using a simple script? (1 Reply)
Discussion started by: fredao
1 Replies

5. Shell Programming and Scripting

compare two files and to remove the matching lines on both the files

I have two files and need to compare the two files and to remove the matching lines from both the files (4 Replies)
Discussion started by: shellscripter
4 Replies

6. Shell Programming and Scripting

How to find link files

How to find the link files. i have main file, now i want to find all the files linked to it. (4 Replies)
Discussion started by: aju_kup
4 Replies

7. Solaris

Nullifying Zero Link Files

How do I nullify a zero link file. Please help me (0 Replies)
Discussion started by: bluenavi
0 Replies

8. UNIX for Dummies Questions & Answers

Nullifying Zero Link Files

how do i nullify zero link files under /proc please help me (4 Replies)
Discussion started by: bluenavi
4 Replies

9. Solaris

Command to remove existing files in the tar files in Solaris 10

Hi, I am using solaris 10 OS.Please help me out with the commands needed in below two scenarios. 1)How to delete the existing files in the tar file. suppose i have a main tarfile named application.tar and it contains a file called ingres.tar. what is the command to remove ingres.tar... (2 Replies)
Discussion started by: muraliinfy04
2 Replies

10. Solaris

Zero link count files in proc

Hi Experts, I had encountered an issue where the zero link process was holding too much amount of data on a Solaris server. I was able to terminate the process after which the space of the file system was released. 40G /proc/8567/fd/2 Can you please let me know if there are any... (11 Replies)
Discussion started by: dhanu1985
11 Replies
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)
All times are GMT -4. The time now is 05:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy