| View previous topic :: View next topic |
| Author |
Message |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Mar 11, 2003 10:50 am Post subject: How to check if a floppy is in the drive? |
|
|
I wanna make a program that backups some files to a floppy.
Is there any way to check if there is a disk in the floppy drive?
I guess I could try to copy a small file to the disk and use the @OK() function, but is there another way to do it? _________________
 |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Tue Mar 11, 2003 11:01 am Post subject: |
|
|
You could do something like this:
| Code: | if @null(@volinfo(A,S))
info No disk in A!
else
info Disk is in!
end |
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Mar 11, 2003 11:07 am Post subject: |
|
|
Great idea. Should have though of that myself
Thanks again Dr.D  _________________
 |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Mar 11, 2003 11:11 am Post subject: |
|
|
Just thought of something else...
What if a user inserts a non formatted floppy?
Than it won't have any diskspace.
Any chance of detecting if the disk is formatted?
Maybe using the filecopy process I mentioned above with the OK function with the volinfo function? _________________
 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Mar 11, 2003 11:13 am Post subject: |
|
|
an alternative,
| Code: |
rem === test to see if there is a floppy in drive ===
directory change, A:\
if @not(@ok())
warn You need to have a floppy in your A:\ drive.
end
|
Serge _________________
|
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Mar 11, 2003 11:16 am Post subject: |
|
|
Nice, thanks Serge.
Will that work if the disk isn't formatted aswell? _________________
 |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Tue Mar 11, 2003 11:22 am Post subject: |
|
|
The code I posted checks for the disk size of A. If the disk is unformatted is won't report any
size, so an unformatted disk should behave like no disk.
You could just adjust the message .. please insert a formatted disk bla-bla..
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Tue Mar 11, 2003 11:25 am Post subject: |
|
|
no idea geotrail - i would have thought that all the floppies one buys today are pre-formatted
give my code a go with an unformatted disk and see what it says - i've never tested it that way
Serge _________________
|
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Tue Mar 11, 2003 11:30 am Post subject: |
|
|
If you make a boot disk for linux and try to access it with windows you'll be asked if you want to format the disk. That's why I'm asking.
But I guess I can just adjust the message telling it to insert a formatted floppy disk.
Why make it harder than it is  _________________
 |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Mar 11, 2003 7:37 pm Post subject: |
|
|
The @volinfo() function will prolly act differently on a non
or different formatted floppy. Check @ok() afterwards.
If not, ya might try some file access commands such as
the DOS "dir" command or VDS "LIST FILELIST", then
check @ok()...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Tue Mar 11, 2003 11:18 pm Post subject: |
|
|
I've used @volinfo(,S) for a similar task. Return will be NULL if the disk is not present, not
formatted or otherwise inaccessible. Haven't had any error reports on that account..
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Wed Mar 12, 2003 11:55 am Post subject: |
|
|
OK, thanks Dr. D. _________________
 |
|
| Back to top |
|
 |
|