forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to check if a floppy is in the drive?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Tue Mar 11, 2003 10:50 am    Post subject: How to check if a floppy is in the drive? Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Tue Mar 11, 2003 11:01 am    Post subject: Reply with quote

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
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Tue Mar 11, 2003 11:07 am    Post subject: Reply with quote

Great idea. Should have though of that myself Laughing

Thanks again Dr.D Wink

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Tue Mar 11, 2003 11:11 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Mar 11, 2003 11:13 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Tue Mar 11, 2003 11:16 am    Post subject: Reply with quote

Nice, thanks Serge.
Will that work if the disk isn't formatted aswell?

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Tue Mar 11, 2003 11:22 am    Post subject: Reply with quote

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
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Tue Mar 11, 2003 11:25 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Tue Mar 11, 2003 11:30 am    Post subject: Reply with quote

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. Wink

Why make it harder than it is Laughing

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Tue Mar 11, 2003 7:37 pm    Post subject: Reply with quote

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()... Wink

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Tue Mar 11, 2003 11:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Mar 12, 2003 11:55 am    Post subject: Reply with quote

OK, thanks Dr. D.
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group