Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!uw-beaver!cornell!batcomputer!theory.tn.cornell.edu!shore From: shore@theory.tn.cornell.edu (Melinda Shore) Newsgroups: comp.unix.aix Subject: Re: Why remove() doesn't remove (symbolic links)? Keywords: remove(), symbolic link Message-ID: <1991May3.212509.6542@batcomputer.tn.cornell.edu> Date: 3 May 91 21:25:09 GMT References: <1991May03.174126.13324@lynx.CS.ORST.EDU> <1991May3.185244.1275@batcomputer.tn.cornell.edu> <1991May03.202209.432@lynx.CS.ORST.EDU> Sender: news@batcomputer.tn.cornell.edu Organization: Cornell Theory Center Lines: 28 Nntp-Posting-Host: theory.tn.cornell.edu In article <1991May03.202209.432@lynx.CS.ORST.EDU> ghe@physics.orst.edu writes: >Which way??? should remove or not??? TFM did not mention a single word on >symbolic links. I just checked MFM and it says that "if the named file is a symbolic link to another file or directory, unlink [aka remove - ms] removes the symbolic link, not the file or directory to which it refers." Note the lengthy listings of error conditions at the end of the man page. > But TFM says nothing about errno. It only >mentioned that 0 is returned upon successful completion, and non-zero >otherwise. errno is a Unix thing, and you need to be familiar with it if you're writing code that makes system calls and you want that code to be reasonably robust. >When I try to call remove(b) ('b' is a symbolic link to a directory 'a'), >perror prints: >remove: Not a directory Probably because there's something wrong with either the pathname you're passing to your program or the pathname your symlink points to. Does your program have the same problem with all symlinks? -- Software longa, hardware brevis Melinda Shore - Cornell Information Technologies - shore@theory.tn.cornell.edu