Path: utzoo!attcan!uunet!decwrl!sdd.hp.com!zaphod.mps.ohio-state.edu!mips!prls!pyramid!infmx!dberg From: dberg@informix.com (David I. Berg) Newsgroups: comp.unix.shell Subject: Re: testing if a file is present Message-ID: <1990Nov21.155149.3505@informix.com> Date: 21 Nov 90 15:51:49 GMT References: Sender: news@informix.com (Usenet News) Distribution: comp.unix Organization: Informix Software, Inc. Lines: 13 In article ger@prisma.cv.ruu.nl (Ger Timmens) writes: >Can anybody tell me how I can verify whether a file exists or not ? >I want to move files and only when they exist ! mv "file" gives an >error message if "file" not exists if (-f filename) will return true if the file exists, false if not. There are many other options for which you can also test: -d if filename is a directory, -z if filename is zero length, -w if filename is writable, etc. RTFM!