QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Determining when a file is done writing to a diskette |
Ref. No. |
QNX.000009676 |
Category(ies) |
Utilities |
Issue |
Is there a way to tell a shell script, in QNX4, when the floppy drive has finished writing to the diskette? We want to be able to copy a file to a floppy and then prompt the user when it has finished.
|
Solution |
The command 'umount' will do this. In the script, explicitly mount the floppy, perform the copy, and then 'umount' it. The 'umount' will block until the file is done copying to the diskette. If, however, the system/environment expects the floppy file system to always be available, then re-arrange things so that the copy is done, then 'umount, and then 'mount' the floppy to put it back. Eg:
mount /dev/fd0 /fd cp blah /fd/blah umount /fd mount /dev/fd0 /fd echo "Finished copying the file" |
|