LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Verify a CD-ROM (https://www.linuxquestions.org/questions/linux-hardware-18/verify-a-cd-rom-298343/)

VorlonInfoTech 03-06-2005 11:54 AM

Verify a CD-ROM
 
I want to test a CD-ROM to ensure all files are readable.

So far, I am using the command:
find /mnt/cdrom -print -exec grep "String Which Will Never Match" {} \;

which is pretty clumsy and checks the contents of every file to see if this goofy string is contained inside.

Anybody have a more elegant way to read each file and make sure they are readable?

I don't have a good MD5 checksum to compare against.

heema 03-07-2005 02:37 AM

you could try something like that :
NOTE : i havent tested it as i am using windows now at work :cry:


#!/bin/bash

count=0
for file in "/mnt/cdrom"
if [ -r $file ];then # True if FILE exists and is readable.
count=$((count+1))
fi

echo "Files readable : $count"


All times are GMT -5. The time now is 09:56 AM.