Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automating burning cd
Message
De
13/04/2003 14:18:03
Liam O'Hagan
O'Hagan Programming Ltd
Irlande
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00777024
Message ID:
00777039
Vues:
15
This message has been marked as a message which has helped to the initial question of the thread.
Hi Igor,

I don't know how to do it on a Windows machine. I searched for utilities to do this and was unsuccessful. For this and a few other reasons I opted for Linux as a server with VFP as the front-end for a particular application. With a Linux box on your network, burning CD's can be as simple as dropping files into a shared folder on the network.

There have been a number of Linux related posts recently so there may be some interest among others on this subject. So here's how I did it....

Setup
1) Using Samba, create two network shares on the Linux box which are visible to the Windows machine. Let's call them "Flags" and "Export". (I'm assuming that these network shares map to /home/samba/flags and /home/samba/export). In addition, create another folder /home/samba

2) Edit the /etc/crontab file and put in a new entry as follows :
* * * * * root /home/scripts/writecd
This will run the writecd script every minute.

3) Create the following script in the folder /home/scripts
#!/bin/bash
# Script   : WriteCD
# Author   : Liam O'Hagan
# Date     : November 2002
# This script is called every minute. If the file /home/samba/isodir/write.cd
# exists then the script continues otherwise it exits.

ExportDir="/home/samba/Export"
ISODir="/home/samba/isodir"
ISOImage=$ISODir"/export.iso"
FlagDir="/home/samba/flags"
WriteFlag=$FlagDir"/write.cd"
WritingFlag=$FlagDir"/writing.cd"

# Does the trigger file exist?
[ -f $WriteFlag ] || exit 0

# Now that we're about to do stuff we need to prevent any other 
# instances of this script from starting
rm -f $WriteFlag

# We also don't want a user to start a new Export Request while we're working
touch $WritingFlag

# Delete any existing ISO image
rm -f $ISOImage 

# Make an ISO image 
mkisofs -JR -o $ISOImage $ExportDir

# Now write the image out to CD
cdrecord speed=4 dev=0,0,0 -eject $ISOImage

# Before we finish, delete the files that were created for this operation
rm -f $ISODir"/*.*"
rm -fr $ExportDir
mkdir $ExportDir
chown guest $ExportDir

# Finally, delete the Writing file
rm -f $WritingFlag
Implementation
Simply copy the files (or folders) into the "Export" directory and create a file called "write.cd" in the flags directory. If you're doing this programmatically, you would first check for the existence of the "writing.cd" file. You would also need to prompt the user to put a CD into the drive in the Linux box.

As the script is run every minute, the CD write will start within a minute and eject the CD when the write is finished.

The script is well commented but feel free to ask any questions.

Hope this helps someone.

Regards,

Liam



>Hi,
>
>Is there any way to automate creating CD, using, for instance, Nero?
>
>TIA
Liam O'Hagan
MCP VFP Desktop Apps
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform