[Gambas-user] test a DVD device

neil lewis gibsonsphoto at ...247...
Fri May 13 13:06:08 CEST 2005

Hi all,

I have a couple of queries.

I'm writing a simple backup program in Gambas for a friend who wants to 
be able to run automated backups between 1GB and 4GB in size.
We decided that a DVD recorder would be the simplest route for this.

The program currently uses a set of GUI based configuration tools to set 
basic configuration, create profiles, manage media, etc. and a non-gui 
part which to be run from CRON to carry out the actual process.

My problem is trying to test the drive to see if it's ready for use, ie 
a DVD is present, it is blank but formatted or it has already been used.

How can I test a DVD writer to see:
    a) If there is a disk present in the drive
    b) If present, whether it is formatted and ready for use
    c) If present and formatted, whether it already contains data

If possible, I'd also like to be able to read the disk label so that the 
program can identify if it should be overwritten or the process should 
abort with an error.

I've tried to start by using TRY file = DIR(/dev/dvdram, "*.*")  where 
file is defined by DIM file as STRING[] at the start of the sub.
I want to read ERROR after this test to decide whether to write to the 
DVD as a new disk (-Z option) or in overwrite mode (-M option) but I 
always get an error, blank or not.

I'm using EXEC["growisofs", "-Z" (or "-M"), device, "-R", "-J" 
Path_to_Files]  to burn the files to the DVD. device is currently 
/dev/dvdram. This part works fine.

Any help would be appreciated.

Neil Lewis.

More information about the User mailing list