Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!rex!uflorida!haven!decuac!hussar.dco.dec.com!mjr From: mjr@hussar.dco.dec.com (Marcus J. Ranum) Newsgroups: comp.unix.internals Subject: Re: How do you find the symbolic links to files. Message-ID: <1990Nov26.193324.5396@decuac.dec.com> Date: 26 Nov 90 19:33:24 GMT References: <1990Nov26.082214.17329@oracle.com> <1990Nov26.150716.7268@specialix.co.uk> Sender: news@decuac.dec.com (Network News) Organization: Digital Equipment Corp., Washington Ultrix Resource Center Lines: 24 jonb@specialix.co.uk (Jon Brawn) writes: >[...] How do I access a symbolic link >file to find out that it IS a symbolic link (I mean from within C, I >assume stat( char *filename ) is going to stat the pointed too file?) use lstat(2), of course. >Does 'find' have a wonderful flag for finding symlinks? read the manual page on find(1). >Also, what about old crusties like 'tar' and 'cpio'? What do they do? tar and cpio [assuming on cpio - I don't use it] use lstat(2) instead of stat(2), as they should. tar also keeps a table of the inode #s of files it has already dumped, and makes a note to make a hard link to the file instead of just storing 2 copies. mjr. -- Good software will grow smaller and faster as time goes by and the code is improved and features that proved to be less useful are weeded out. [from the programming notebooks of a heretic, 1990]