On Sun, 11 Dec 2011 10:40:24 -0400, frank cui wrote: > Ok, to make this question more specific, the author of this book is > making a program to check if the files can be read off from the disk. > And he does so by checking two steps, first is making sure the meta data > of this file looks fine, and secondly by reading byte by byte from this > file to actually check the file's content readability.
As a "toy" example demonstrating the use of filetest operators and sysread (), this is okay. It's hard to come up with decent short examples. Just as long as you don't come away thinking that this is really how you would test to see if you could read a file. I see people using access checks all the time when they should simply be testing that they can open() the file instead. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/certificates/perl-programming.php -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/