Seek to end of file returns 136 on CD/DVD drives

Steve O'Hara-Smith steve at sohara.org
Thu Dec 17 02:05:21 PST 2009


	Hi,

	The following code always returns 136 (0x88) - no matter what is in
the drive (even no media at all). The same thing happens with cd0, acd0s1
and cd0s1 and acd1 etc. acd0 is a SATA DVD burner, acd1 is a PATA DVD
reader.

int main (int argc, char **argv)
{
   int file = open ("/dev/acd0", O_RDONLY);
   off_t end = lseek(file, 0, SEEK_END);
   printf ("Size = %ld\n", end);
}

-- 
Steve O'Hara-Smith                          |   Directable Mirror Arrays
C:>WIN                                      | A better way to focus the sun
The computer obeys and wins.                |    licences available see
You lose and Bill collects.                 |    http://www.sohara.org/





More information about the Bugs mailing list