Afficher un message
Vieux 24/03/2008, 19h54   #2
James Michael Fultz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: testing files for read errors by copying to /dev/null

* Charles Russell <NOSPAM@bellsouth.net>:
> I would like to test the integrity of a CD (after burning from .iso) by
> reading all its files and looking for error messages. (I'm using Cygwin,
> so I cannot access the CD drive as a dev/, only as a mounted filesystem.)
>
> If I try
> cp -rv /cygdrive/d/* /dev/null
> then I get a message that /dev/null is not a file or directory
>
> If I try
> tar -cvf /dev/null /cygdrive/d
> then the command runs so fast it cannot possibly be reading the whole CD.
>
> If I try
> find /cygdrive/d -type f -name '*' -print -exec cat {} >/dev/null \;
> then the disk drive seems active for a reasonable length of time, but
> despite the -print flag, I get no output to confirm what is actually
> happening. I expected the filename to be printed before each file was
> read.


The shell is responsible for redirection so...

$ find /cygdrive/d -type f -print -exec sh -c 'cat "$1" >/dev/null' {} {} \;

> What is the best way to do what I am attempting?


Not sure whether it is the *best* way, but the following should work:

$ find /cygdrive/d -type f -exec cp -v {} /dev/null \;

--
James Michael Fultz <xyzzy@sent.as.invalid>
Remove this part when replying ^^^^^^^^
  Réponse avec citation
 
Page generated in 0,04865 seconds with 9 queries