Re: File Test Question

2005-11-30 Thread jm
according to Programming Perl (p. 98)... -w = file is writable by effective uid/gid -s = file has nonzero size (returns size) -w only tells if the file's permissions allow it to be written to, has nothing to do with whether or not it already has data. save the return value of -s and check that v

RE: File Test Question

2005-11-30 Thread Timothy Johnson
I don't think the -x tests mean what you think they mean. >From "perldoc -f -x": -r File is readable by effective uid/gid. -w File is writable by effective uid/gid. -x File is executable by effective uid/gid. -o File is owned by effective uid. -R File is

Re: File Test Question

2005-11-30 Thread Wiggins d'Anconia
Dave Adams wrote: > *My Code:* > > my $logfile = "logfile_with_content"; > if (-w $logfile) { > print ("True - file exists but empty"); > } > if (-s $logfile) { > print ("True - file exist and has content"); > } > > *My Output:* > > True - file exists but empty True - file exist and has