Sponsored Content
Top Forums UNIX for Dummies Questions & Answers links.... soft or hard.. not sure? Post 30582 by janr on Thursday 24th of October 2002 05:39:24 AM
Old 10-24-2002
When you do `ls -l` the command is looking in the I-node table and not on the disk.

So once when the link was created the dirtectoy /adir exists.
Afterwards someone deleted this directory /adir

you end up without directory /adir, and with a link
`filea -> /adir/filea`

When you recreate the directory and the file /adir/filea, the link should be re-astebilst

Last edited by janr; 10-24-2002 at 06:53 AM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

links: (soft, hard? symbolic??) inode

Hi, what is link? and soft link? how about hard one and symbolic link. and inode. i get confuse about this links. could anyone help me with full explainsion? thks Gusla (5 Replies)
Discussion started by: gusla
5 Replies

2. Shell Programming and Scripting

using find to locate hard and soft links with tar

I am digging for certain types of files in the current directory and all its sub-directories and archiving them with the following code: #! /usr/bin/ksh Archive=`date +%Y_%m_%d_%T` find . -type f \( -name \*\.ksh -o -name \*\.sql -o -name \*\.ini \) -print|xargs tar -cf... (4 Replies)
Discussion started by: manthasirisha
4 Replies

3. UNIX for Dummies Questions & Answers

Command to find all soft links in a directory

I need the command to find all soft links in a directory. Can someone please help. Thank you. (2 Replies)
Discussion started by: jgeo01
2 Replies

4. Programming

creating soft links

i'm trying to write a c code to copy a soft link over to a specified directory. Is it possible to do this without using symlink()? if so, what can I use? Thanks! (2 Replies)
Discussion started by: l flipboi l
2 Replies

5. Solaris

Hard Links and Soft or Sym links

When loooking at files in a directory using ls, how can I tell if I have a hard link or soft link? (11 Replies)
Discussion started by: Harleyrci
11 Replies

6. AIX

List all the soft links and hard links

Hi I'm logged in as root in an aix box Which command will list all the soft links and hard links present in the server ? (2 Replies)
Discussion started by: newtoaixos
2 Replies

7. UNIX for Dummies Questions & Answers

Simple example for soft and hard links

Hai, give me a simple example for soft and hard links. this will work for soft link ?? ln -s (2 Replies)
Discussion started by: Ramesh M
2 Replies

8. Shell Programming and Scripting

Timestamp change for hard and soft links

Hi team, i am writing a purge script to delete softlinks and hardlinks on linux system which are 3/10/30 days old. To test the script i need to create links with old timestamp, i am able to cange timestamp for files but not for links. i tried touch -h option but this option is not available on... (1 Reply)
Discussion started by: Satyak
1 Replies

9. UNIX for Dummies Questions & Answers

Soft links question

Hello. I have some main directories. For example : /main_dir1 /main_dir2In main_dir2, I have a sub dir named sub_dir2-1 with 2 files in it ( file_2-1, file_2-2 ) /main_dir2sub_dir2-1file_2-1 file_2-2From "/main_dir1/A/B/C" I make a soft link ln -s /main_dir2/sub_dir2-1 ... (6 Replies)
Discussion started by: jcdole
6 Replies
link(2) 							System Calls Manual							   link(2)

NAME
link - Creates a hard link to an existing file on the local file system SYNOPSIS
#include <unistd.h> int link ( const char *path1, const char *path2 ); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: link(): XSH5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Points to the pathname of an existing file. Points to the pathname for the directory entry to be created. If the path2 parameter names a symbolic link, an error is returned. DESCRIPTION
The link() function creates an additional hard link (directory entry) for an existing file. The old and the new link share equal access rights to the underlying object. The link() function atomically creates a new link for the existing file and increments the link count of the file by one. Both the path1 and path2 parameters must reside on the same file system. A hard link to a directory cannot be created. Upon successful completion, the link() function marks the st_ctime field of the file for update, and marks the st_ctime and st_mtime fields of the directory containing the new entry for update. A process must have write permission in the target directory with respect to all access control policies configured on the system. See symlink(2) for information about making symbolic links, including Context Dependent Symbolic Links (CDSLs). RETURN VALUES
Upon successful completion, the link() function returns a value of 0 (zero). If the link() function fails, a value of -1 is returned, no link is created, and errno is set to indicate the error. ERRORS
If the link() function fails, errno may be set to one of the following values: The requested link requires writing in a directory with a mode that denies write permission, or a component of either the path1 or path2 parameter denies search permission. The requested link requires writing in a directory to which the process does not have write access with respect to one or more of the system's configured access policies. The directory in which the entry for the new link is being placed cannot be extended because the user's quota of disk blocks on the file system containing the directory has been exhausted. The link named by the path2 parameter already exists. The path1 or path2 parameter is an invalid address. [Tru64 UNIX] An I/O error occurred when updating the directory. Too many links were encountered in translating path1 or path2. The number of links to the file named by path1 would exceed LINK_MAX. The length of the path1 or path2 string exceeds PATH_MAX or a pathname component is longer than NAME_MAX. The file named by the path1 parameter does not exist or the path1 or path2 parameter is an empty string. The directory in which the entry for the new link is being placed cannot be extended because there is no space left on the file system containing the directory. A component of either path prefix is not a directory. The file named by the path1 parameter is a directory. The requested link requires writing in a directory on a read-only file system. The link named by the path2 parameter and the file named by the path1 parameter are on different file systems. [Tru64 UNIX] For NFS file access, if the link() function fails, errno may also be set to one of the following values: Indicates that the system file table is full or there are too many files currently open in the system. Indicates a stale NFS file handle. An opened file was deleted by the server or another client; a client cannot open a file because the server has unmounted or unexported the remote directory; or the directory that contains an opened file was unmounted or unexported by the server. RELATED INFORMATION
Commands: link(1), unlink(1) Functions: unlink(2), symlink(2) Standards: standards(5) delim off link(2)
All times are GMT -4. The time now is 06:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy