130 posts
Location
Here
Posted 06 March 2016 - 05:07 PM
anyone know how to set the name of a floppy disk when attached to a disk drive over the network?
129 posts
Location
I honestly don't know
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:
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)
130 posts
Location
Here
Posted 06 March 2016 - 05:14 PM
so in short, you can't set it directly
Edited on 06 March 2016 - 04:14 PM
129 posts
Location
I honestly don't know
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_APIsand here is some code that
*MIGHT* work:
ModemID = 'disk_0'
d = peripheral.wrap(ModemID)
d.setLabel('ThisIsALabel')
Edited on 06 March 2016 - 04:24 PM
7083 posts
Location
Tasmania (AU)
Posted 06 March 2016 - 10:34 PM
When using the disk API, you'd simply do:
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.
2427 posts
Location
UK
Posted 07 March 2016 - 11:47 AM
and here is some code that *MIGHT* work:
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 on 07 March 2016 - 10:47 AM