home *** CD-ROM | disk | FTP | other *** search
- $file = 'ADFS::IDEDisc4.$.Perl.!Perl.c.acorn ';
- #$file = '';
- #$file = 'ADFS::IDEDisc4.$.Perl.pl.Tests';
- #$file = 'ADFS::IDEDisc4.$.Perl.pl.zero';
-
-
- print"Trying to test file $file\n\n\n";
-
- if ( -e $file) { print("This file exists\n") ; }
- else { print("This file does not exist\n") ; }
-
- if ( -z $file) { print("This file has zero size\n") ; }
- else { print("This file does not have zero size\n") ; }
-
- $dummy = "A dummy line to change the stack for $file";
-
- print"Using _, the returned size is ",( -s _),"\n";
- if ( -s $file) { print("This file has nonzero size\n") ; }
- else { print("This file does not have nonzero size\n") ; }
- print"The returned value is ",( -s $file),"\n";
-
-
- if ( -f $file) { print("This is a plain file\n") ; }
- else { print("This is not a plain file\n") ; }
-
- if ( -d $file) { print("This is a directory\n") ; }
- else { print("This is not a directory\n") ; }
-
- if ( -T $file) { print("This is a text file\n") ; }
- else { print("This is not a text file\n") ; }
-
- if ( -T _) { print("Using _, this is a text file\n") ; }
- else { print("Using _, this is not a text file\n") ; }
-
- if ( -B $file) { print("This is a binary file\n") ; }
- else { print("This is not a binary file\n") ; }
-
-
- print "M stamp:", ( -M $file), "\n";
- print "A stamp:", ( -A $file), "\n";
- print "C stamp:", ( -C $file), "\n";
- print "Private read (r stamp):", ( -r $file) ? "Yes" : "No", "\n";
- print "Private write (w stamp):", ( -w $file) ? "Yes" : "No", "\n";
- print "Private execute (x stamp):", ( -x $file) ? "Yes" : "No", "\n";
- print "Private owner (o stamp):", ( -o $file) ? "Yes" : "No", "\n";
- print "Public read (R stamp):", ( -R $file) ? "Yes" : "No", "\n";
- print "Public write (W stamp):", ( -W $file) ? "Yes" : "No", "\n";
- print "Public execute (X stamp):", ( -X $file) ? "Yes" : "No", "\n";
- print "Public owner (O stamp):", ( -O $file) ? "Yes" : "No", "\n";
-
-
- print"Trying to test file $file by handle\n\n\n";
- open(HANDLE, $file);
- if ( -f HANDLE) { print("This is a file\n") ; }
- else { print("This is not a file\n") ; }
-
-
- print"\nDone\n";