Jump to content

Problem with floppy disk

command help lua

3 replies to this topic

#1 CloudyChmura

  • New Members
  • 1 posts

Posted 11 December 2016 - 07:46 PM

I am green from that I start.
I have a problem with a program that needs to verify whether it is on a floppy disk or on a computer or it can be something to check?

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,464 posts

Posted 11 December 2016 - 08:35 PM

Moved to Ask a Pro.

#3 supernicejohn

  • Members
  • 98 posts
  • LocationSweden

Posted 11 December 2016 - 09:24 PM

Not too familiar with floppy disks and the like, but I think
Will do the trick. Not sure, but that's how I'd determine the directory to a program on the computer.

#4 Anavrins

  • Members
  • 775 posts

Posted 11 December 2016 - 09:54 PM

Use fs.getDrive instead.
It will return "hdd" if the file is located locally on the computer, or "rom" if it's in rom.
If your file is running on a disk then it will return the side where your drive is located.
local fDrive = fs.getDrive(shell.getRunningProgram())
if fDrive == "hdd" or fDrive == "rom" then
  print("File is running from hdd")
  print("File is on a floppy")

Edited by Anavrins, 11 December 2016 - 09:59 PM.

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users