Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read / write to floppy disk

Status
Not open for further replies.

moleproductions

Programmer
Oct 23, 2003
43
0
0
GB
Hi,

Does anyone have any experience of writing to and then reading from a floppy disk using Director and lingo?

I am producing a training CD and would like to be able to allow the user to save information and the results of test to a floppy disk so that Director can load it and review it later. The user won't be completing the whole of the training course in one go.

Another way might be to use the internet to save the data, but there is no guarantee that the PC being used will have internet access. I guess there's no guarantee they'll have a floppy disk drive either - but in the environment this tool is aimed at - it's much more likely.

Any thoughts most welcome.
Thanks,
Tim
 
First you'll need to find a drive letter for the floppy drive. Buddy API function baDiskList() returns all the drive letters in a machine and baDiskInfo() returns the disk info for the given drive. Therefore you can do:
--
on findFloppyDrive
tMsg = "Doesn't exist."
tDiskList = baDiskList()
tDiskCount = tDiskList.count
repeat with i = 1 to tDiskCount
tDrive = tDiskList
if baDiskInfo(tDrive, "size") < 2048 then
tMsg = tDrive
exit repeat
end if
end repeat
return tMsg
end findFloppyDrive
--
put findFloppyDrive()
-- "A:\"
--
NB. baDiskInfo("a:\", "type") should return "Floppy" according to the Buddy API documentation and if it does it would be more straightforward. In reality it returns "Removable" instead, so I decided to check the size of the disk and if it's less than 2MB I am assuming it's a floppy disk.

Kenneth Kawamoto
 
Sounds tricky, since many people consider zip disks also to be "floppy" and now with the advent of memory keys even more so. You may want to have them choose from a list of the drives that you detect. Why not just write to the hard drive?

Cheers~Frank
 
Ok - thanks.

I will try this out and see.

Frank - you're right in many ways this would be the easy option. However, the users of this Dirctor authored Training CD would be using shared machines available at their company premises - and therefore writing to the hard disk would not be an option (or possibly allowed). It's possible that a Floppy disk would be sent out with the CD for this very purpose.

Having said that, it did occur to me that having the option of USB memory key or floppy etc. would be smart move.

Perhaps some form of option would be best here.
Thanks,
Tim
 
I agree, I wouldn't use a floppy myself - actually it took me a while to find a disk to test the code above! And my G5 doesn't even have a floppy drive.

But if Tim is creating a product specific to a certain environment where floppy disk is still a valid and useful media, why not...!!

Kenneth Kawamoto
 
Good point Kenneth!

Tim~Where's Q when you need him? ;)

Cheers~Frank
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top