From: Joel VanderWerf Date: 2006-04-12T02:51:38+09:00 Subject: Re: Best way to test for file existence? Wes Gamble wrote: > All, > > What is the best way to determine the existence of a file (more > specifically, a directory)? > > Are there Perl - like file test operators available? > > Wes > $ ri test | cat ------------------------------------------------------------ Kernel#test test(int_cmd, file1 [, file2] ) => obj ------------------------------------------------------------------------ Uses the integer aCmd to perform various tests on file1 (first table below) or on file1 and file2 (second table). File tests on a single file: Test Returns Meaning ?A | Time | Last access time for file1 ?b | boolean | True if file1 is a block device ?c | boolean | True if file1 is a character device ... and so on... -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407