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?
8543 posts
Posted 11 December 2016 - 08:35 PM
Moved to Ask a Pro.
101 posts
Location
Sweden
Posted 11 December 2016 - 09:24 PM
Not too familiar with floppy disks and the like, but I think
fs.getDir(shell.getRunningProgram())
Will do the trick. Not sure, but that's how I'd determine the directory to a program on the computer.
756 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")
else
print("File is on a floppy")
end
Edited on 11 December 2016 - 08:59 PM