Jump to content




copy failed


11 replies to this topic

#1 makerimages

  • Members
  • 236 posts

Posted 23 September 2012 - 09:14 AM

term.clear()
textutils.slowPrint("-----------",10)
term.clear()
print("Dear user, welcome to the installation process of makerOS!")
sleep(5)
print("You will now bw guided trough the installation process of your brand new makerOS release!")
sleep(5)
term.clear()
os.loadAPI("/disk/APIS/menus")
menus.inMenu()
menus.selection()

local input = read() 
if input == "1" then 
fs.copy("/disk/OS/mOSsup","startup")
fs.copy("/disk/OS/mOS","/mOS/OS")
fs.copy("/APIS/mOSapi","/APIS/mOSapi")
print("please remove disk and reboot computer!")
elseif input == "2" then
print("Installation cancelled by user,rebooting")
sleep(4)
os.reboot()
else
  print("Invalid selection, please try again")
  sleep(4)
  os.reboot() 
end

somehow on line 16 this says that copy failed, whats wrong(the filepaths are not wrong i checked)

#2 Kolpa

  • New Members
  • 260 posts
  • LocationGermany

Posted 23 September 2012 - 09:21 AM

i never used fs.copy() but i would check if the /mOS/ folder exists

#3 makerimages

  • Members
  • 236 posts

Posted 23 September 2012 - 09:25 AM

thats supposed to be created by the program

#4 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 23 September 2012 - 10:31 AM

There is nothing in your code which creates the folder. How do you expect it to be created?

In addition, this line of code makes no sense:
fs.copy("/APIS/mOSapi","/APIS/mOSapi")
You're copying a file to the same location as it is right now.

#5 Kolpa

  • New Members
  • 260 posts
  • LocationGermany

Posted 23 September 2012 - 10:37 AM

 Cloudy, on 23 September 2012 - 10:31 AM, said:

There is nothing in your code which creates the folder. How do you expect it to be created?

In addition, this line of code makes no sense:
fs.copy("/APIS/mOSapi","/APIS/mOSapi")
You're copying a file to the same location as it is right now.
well i suppose thanks for doing my job :P/>

#6 makerimages

  • Members
  • 236 posts

Posted 23 September 2012 - 12:10 PM

 Cloudy, on 23 September 2012 - 10:31 AM, said:

There is nothing in your code which creates the folder. How do you expect it to be created?

In addition, this line of code makes no sense:
fs.copy("/APIS/mOSapi","/APIS/mOSapi")
You're copying a file to the same location as it is right now.

thats my bad there, dunno how i missed that, but what function creates a folder then??

#7 sjele

  • Members
  • 334 posts
  • LocationSomewhere on the planet called earth

Posted 23 September 2012 - 12:11 PM

fs.makeDir("path/to/place")


#8 makerimages

  • Members
  • 236 posts

Posted 23 September 2012 - 12:14 PM

thanks

#9 makerimages

  • Members
  • 236 posts

Posted 23 September 2012 - 04:15 PM

i dont want to make a another thread, but:



--[[Copyright Makerimages, all of the code here was made by makerimages and you may not distribute this code without written premission]]--

function Logo()
print(" __  __       _              ____   _____")
print("|  /  |     | |            / __  / ____|")
print("|   / | __ _| | _____ _ __| |  | | (___  ")
print("| |/| |/ _` | |/ / _ | '__| |  | |___  ")
print("| |  | | (_| |   |  __| |  | |__| |____) | ")
print("|_|  |_|__,_|_|____|_|   ____/|_____/ ")
end

function Logosplash()
randomSplash = {
"Now with the amazing resolution of "..screen.sizeX.."x"..screen.sizeY.."!!!",
"More Lua than in LUALAND",
"All done in Lua!",
"Youre pointless!",
"Why to bother reading?",
"New feature-BUGS!",
}
 term.write(randomSplash[math.random(table.getn(randomSplash))])
end
end 



says that on line 23 a eof is aspected

and:



--[[Copyright Makerimages, all of the code here was made by makerimages and you may not distribute this code without written premission]]--

os.loadAPI("/APIS/mOSapi")
mOSapi.Logo()
mOSapi.Logosplash()
sleep(5)
clear()
textutils.slowPrint("Loading operating system","3","center")
clear()
textutils.slowPrint("Please Log into makerOS","3","center")

shell.run("/mOS/OS")



sasys that on line 4 attempt to index ? (a nil value)

how to fix them?

#10 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 23 September 2012 - 04:45 PM

1. Remove the last end, it's not needed there.
2. It looks like the api is not loaded. Maybe there's an error in the api. You should always check if the api is loaded:
os.loadAPI("/apis/myApi")
if not myApi then
  error("Error loading api")
end


#11 Anonomit

  • Members
  • 67 posts

Posted 23 September 2012 - 05:10 PM

makerimages, It might be easier to use a multi-line print in your Logo() function.
Sometimes it makes it easier to see how it will look on the screen.


function Logo()
print[[
__  __	   _			  ____   _____
|  /  |	 | |			/ __  / ____|
|   / | __ _| | _____ _ __| |  | | (___
| |/| |/ _` | |/ / _ | '__| |  | |___ 
| |  | | (_| |   |  __| |  | |__| |____) |
|_|  |_|__,_|_|____|_|   ____/|_____/
]]
end



#12 ChaddJackson12

  • Members
  • 264 posts

Posted 26 September 2012 - 02:00 PM

Here's something that I think has to happen, and this might help you quite a bit. You have to make a directory for copying files. You can't copy a file to a nonexistent directory. Or at least it hasn't worked for me. Good luck.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users