1 posts
Posted 24 June 2013 - 04:22 AM
What is wrong with this code?
local copyId= disk.getLabel("left")
if disk.isPresent("left") then
print("Downloading "..copyId)
fs.copy("disk/" ..copyId, copyId.." ")
print(copy)
end
it says
line 6( the fs.copy line) 'No such file'
idk how to fix this :/ any help would be nice.. and sorry for the terrible layout of this message :(/>/>
Edited by
8543 posts
Posted 24 June 2013 - 01:16 PM
Split into new topic.
What does the program output before the error? What is the label of the disk? What files are on the disk?
1583 posts
Location
Germany
Posted 25 June 2013 - 04:32 PM
Mybe there isn't a file with the Disks label on it…
604 posts
Location
Spring Hill, Fl
Posted 25 June 2013 - 08:44 PM
Alright I see the prob. In terms of how you use your program your way, it's illeagal. Im seeing that you want a copy program so, I really kinda made it simpler to use. Heres a guide to use it: When it askes you for the item to copy, just copy down the path(ex:disk/file/file/image.nfp or something). And for when for where to paste it, paste the path like befor and always put down what you want to name the copy at the end.
Here it is:
--local copyId = disk.getLabel("left")
--if disk.isPresent("left") then
print("What do you want to copy?")
copy = read()
print("Type in where you want to copy the program to:")
location = read()
print("Downloading "..copy)
fs.copy(copy,location)
print("Copy done!")
end
Or for pastebin for easy download:
txwkA9Lw
Give me a thumbs up(1+) if this helped!
515 posts
Location
Australia
Posted 26 June 2013 - 11:52 AM
local copyId= disk.getLabel("left")
if disk.isPresent("left") then
print("Downloading "..copyId)
if fs.exists("/disk/" .. copyId) then
fs.delete("/" .. copyId)
fs.copy("/disk/" ..copyId, "/" .. copyId)
else
print("Error: Could not find ", copyId, " on disk!")
end
end
-- print(copy) What's this for???
end
1583 posts
Location
Germany
Posted 26 June 2013 - 11:56 AM
^
The print(copy) will crash because there isn't a variable called "copy"!
8543 posts
Posted 26 June 2013 - 12:37 PM
No, it would print "nil", not crash. If it weren't commented out.
892 posts
Location
Where you'd least expect it.
Posted 26 June 2013 - 07:13 PM
It would print nothing if it was nil, just make a new line.