Re: File health check on *nix system using stat

2011-12-12 Thread Peter Scott
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, an

Re: File health check on *nix system using stat

2011-12-12 Thread John W. Krahn
frank cui wrote: Thanks John and Peter for the reply. 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, Yes,

Re: File health check on *nix system using stat

2011-12-11 Thread frank cui
Thanks John and Peter for the reply. 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 b

Re: File health check on *nix system using stat

2011-12-10 Thread Peter Scott
On Sat, 10 Dec 2011 11:11:15 -0400, frank cui wrote: > # attempt to read the directory entry for this file my @stat = > stat($name); > if ( !$stat[4] && !$stat[5] && !$stat[6] && !$stat[7] && !$stat[8] ) { > return 0;# according to the code context, here > it is saying the f

Re: File health check on *nix system using stat

2011-12-10 Thread John W. Krahn
frank cui wrote: hi, Hello, I'm reading the book of "automating system administration with perl" and having doubts about this code snippets about file health check. # attempt to read the directory entry for this file my @stat = stat($name); That should probably be: my @stat = stat($name)

File health check on *nix system using stat

2011-12-10 Thread frank cui
hi, I'm reading the book of "automating system administration with perl" and having doubts about this code snippets about file health check. # attempt to read the directory entry for this file my @stat = stat($name); if ( !$stat[4] && !$stat[5] && !$stat[6] && !$stat[7] && !$stat[8] ) { return 0;