anyone know how to set the name of a floppy disk when attached to a disk drive over the network?
1
5 replies to this topic
#1
Posted 06 March 2016 - 05:07 PM
#2
Posted 06 March 2016 - 05:12 PM
this code requires computer b, the receiving computer, to have a drive on the left. and for both computers to have wireless modems on the top
btw, this is by no means secure
computer a:
computer b:
btw, this is by no means secure
computer a:
rednet.open('top') write('Label: ') r = read() rednet.broadcast(r)
computer b:
rednet.open('top') i, m = rednet.receive() shell.run('label set left ' .. m)
#3
Posted 06 March 2016 - 05:14 PM
so in short, you can't set it directly
Edited by jacky500, 06 March 2016 - 05:14 PM.
#4
Posted 06 March 2016 - 05:23 PM
you MIGHT be able to set it directly using wired modems and just wrapping it as a peripheral.
sadly i dont have access to a mc installation rn so i cant test.
these wonderful pages on the wiki might be able to help:
http://www.computerc...wiki/Disk_(API)
http://www.computerc...eripheral_(API)
http://www.computerc...Peripheral_APIs
and here is some code that *MIGHT* work:
sadly i dont have access to a mc installation rn so i cant test.
these wonderful pages on the wiki might be able to help:
http://www.computerc...wiki/Disk_(API)
http://www.computerc...eripheral_(API)
http://www.computerc...Peripheral_APIs
and here is some code that *MIGHT* work:
ModemID = 'disk_0' d = peripheral.wrap(ModemID) d.setLabel('ThisIsALabel')
Edited by doublequestionmark, 06 March 2016 - 05:24 PM.
#5
Posted 06 March 2016 - 10:34 PM
When using the disk API, you'd simply do:
If you wanted to wrap the drive as a peripheral, you'd do:
DQM, please don't post code unless you know it works. If you have to wait to test it, then by all means wait - it's better than causing confusion by posting incorrect info.
disk.setLabel("drive_0", "NewLabel")
If you wanted to wrap the drive as a peripheral, you'd do:
local drive = peripheral.wrap("drive_0") drive.setDiskLabel("NewLabel")
DQM, please don't post code unless you know it works. If you have to wait to test it, then by all means wait - it's better than causing confusion by posting incorrect info.
#6
Posted 07 March 2016 - 11:47 AM
doublequestionmark, on 06 March 2016 - 05:23 PM, said:
and here is some code that *MIGHT* work:
Bomb Bloke, on 06 March 2016 - 10:34 PM, said:
DQM, please don't post code unless you know it works. If you have to wait to test it, then by all means wait - it's better than causing confusion by posting incorrect info.
There is always the wiki to check that you are using an API correctly
Edited by Lupus590, 07 March 2016 - 11:47 AM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users