56 posts
Location
Germany
Posted 21 February 2015 - 09:09 PM
shell.run"clear"
term.setBackgroundColor(colors.lightGray)
term.setTextColor(colors.white)
shell.run"clear"
—
Bild = paintutils.loadImage("OS/program.img")
paintutils.drawImage(Bild,1,1)
—
term.setCursorPos(1,7)
term.setBackgroundColor(colors.lightGray)
print("Enter name of the Background you want to choose")
print("")
write("Name:")
name = io.read()
shell.run"cd //"
shell.run"cd BG"
shell.run('rom/programs/move/', name..'OS/d1.img') – why doesnt work this ? The picture exist
–shell.run"cd .."
–shell.run"cd OS"
–shell.run"desktop"
Edited on 21 February 2015 - 08:10 PM
1023 posts
Posted 21 February 2015 - 09:14 PM
the program rom/programs/move requires 2 arguments you only pass it one. It requires the file you want to move and where to move it, and you only supplied the file you want to move.
shell.run('rom/programs/move',name..'OS/d1.img',targetfile)
Even though you can accomplish what you want to do using shell.run you could also accomplish it using the fs api.
fs.move('OS/d1.img',targetfile)
56 posts
Location
Germany
Posted 21 February 2015 - 09:26 PM
the program rom/programs/move requires 2 arguments you only pass it one. It requires the file you want to move and where to move it, and you only supplied the file you want to move.
shell.run('rom/programs/move',name..'OS/d1.img',targetfile)
Even though you can accomplish what you want to do using shell.run you could also accomplish it using the fs api.
fs.move('OS/d1.img',targetfile)
print("Enter name of the Background you want to choose")
print("")
write("Name:")
name = io.read()
shell.run"cd //"
shell.run"cd BG"
fs.move("name", "OS/d1.img")
nothing happend error no such file
1023 posts
Posted 21 February 2015 - 09:29 PM
the program rom/programs/move requires 2 arguments you only pass it one. It requires the file you want to move and where to move it, and you only supplied the file you want to move.
shell.run('rom/programs/move',name..'OS/d1.img',targetfile)
Even though you can accomplish what you want to do using shell.run you could also accomplish it using the fs api.
fs.move('OS/d1.img',targetfile)
print("Enter name of the Background you want to choose")
print("")
write("Name:")
name = io.read()
shell.run"cd //"
shell.run"cd BG"
fs.move("name", "OS/d1.img")
nothing happend error no such file
Its the file you want to move and then where you want to move it. In that example you are trying to move the file "name" to "OS/d1.img" I am assuming you want to move "OS/d1.img" to "name", so you would want to do this
fs.move("OS/d1.img",name) --name without "" since it is a variable
Edited on 21 February 2015 - 08:29 PM
56 posts
Location
Germany
Posted 21 February 2015 - 09:37 PM
the program rom/programs/move requires 2 arguments you only pass it one. It requires the file you want to move and where to move it, and you only supplied the file you want to move.
shell.run('rom/programs/move',name..'OS/d1.img',targetfile)
Even though you can accomplish what you want to do using shell.run you could also accomplish it using the fs api.
fs.move('OS/d1.img',targetfile)
print("Enter name of the Background you want to choose")
print("")
write("Name:")
name = io.read()
shell.run"cd //"
shell.run"cd BG"
fs.move("name", "OS/d1.img")
nothing happend error no such file
Its the file you want to move and then where you want to move it. In that example you are trying to move the file "name" to "OS/d1.img" I am assuming you want to move "OS/d1.img" to "name", so you would want to do this
fs.move("OS/d1.img",name) --name without "" since it is a variable
no such file ..
I want to move my name variable to d1.img
Edited on 21 February 2015 - 08:44 PM
56 posts
Location
Germany
Posted 21 February 2015 - 09:48 PM
So i have change it to
fs.move(name,"OS/d1.img")
but still no such file
Edited on 21 February 2015 - 08:56 PM
1023 posts
Posted 21 February 2015 - 10:11 PM
So i have change it to
fs.move(name,"OS/d1.img")
but still no such file
You still have it backwards…
name is LAST
its fs.move("OS/d1.img",
name)
notice name is after "OS/d1.img" not before
56 posts
Location
Germany
Posted 21 February 2015 - 10:16 PM
So i have change it to
fs.move(name,"OS/d1.img")
but still no such file
You still have it backwards…
name is LAST
its fs.move("OS/d1.img",
name)
notice name is after "OS/d1.img" not before
No such file ..
again that we do not talk past each other, I would like the input name Renaming in d1.img
56 posts
Location
Germany
Posted 21 February 2015 - 10:37 PM
anybody ?
3057 posts
Location
United States of America
Posted 21 February 2015 - 10:38 PM
anybody ?
I'm not really sure what the problem is here, or what you are trying to accomplish. If you'd fill me in, I'd be happy to help.
8543 posts
Posted 21 February 2015 - 10:44 PM
fs.move requires absolute paths, so you need to use fs.combine to tack on the first part of the path:
fs.move(fs.combine("/BG", name), "/OS/d1.img")
56 posts
Location
Germany
Posted 21 February 2015 - 10:50 PM
anybody ?
I'm not really sure what the problem is here, or what you are trying to accomplish. If you'd fill me in, I'd be happy to help.
The programm should change the background in the desktop. To do that there are two programmes one with witch one you create your custom background,and save it in the dir BG, that works fine. The other programm where the problem is should remove the old background d1.img is the name of it (that works), and rename (one file that have you painted and is in your BG dir) in d1.img so taht you have changed the background with your painted file.
fs.move requires absolute paths, so you need to use fs.combine to tack on the first part of the path:
fs.move(fs.combine("/BG", name), "/OS/d1.img")
It works thx man you save my day :D/>
Edited on 21 February 2015 - 09:50 PM