This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Quinncunx's profile picture

[LUA] [HELP] How to programatically copy a file from disk to root directory of console

Started by Quinncunx, 16 June 2012 - 10:59 PM
Quinncunx #1
Posted 17 June 2012 - 12:59 AM
Effectively I am trying to make an installer/uninstaller for a program, how do I programatically copy a file from the disk to the root directory of the console. I was thinking this


fs.copy("file", ".. /file")
[/CODE

however it is telling me Invalid path, though if I was to type that as a shell command it would work. 

So I am a bit confused.
tfoote #2
Posted 17 June 2012 - 02:02 AM
I have tried to copy things to the rom… It doesn't let you do it… As long as you copy them not to the rom you will be fine…


fs.copy("file", "/file") -- That should work... Let me know otherwise
MysticT #3
Posted 17 June 2012 - 02:03 AM
The paths given to fs.copy (and any fs function) must be absolute. So you have to do: fs.copy("disk/file", "file")