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

Better (remote) control/identification to/from disk drives

Started by InDieTasten, 30 March 2013 - 05:01 PM
InDieTasten #1
Posted 30 March 2013 - 06:01 PM
Hi,

i started to play with 1.5.1 and took a look to the "new" remote control via the "lan"-networks.
i started building a datacenter(some servers and lots of disk drives) and noticed that there are no remoteMethods for the diskDrive. after they are connected the drives appear in the root directory as disk1, disk2…disk32. but these numbers aren't assigned to the Remotenames of the drives. so i can't manage the drives when floppies where pulled out. then all disks loaded after it get a smaller value than berfore.

so my first idea is to add remoteMethods to the drives like:

wiredModem = peripheral("side")
wiredModem.callRemote("disk_1", "getLabel")

and this with all methods from the disk(api). the problem with the identification isn't solved with this.

second and easier way for identifying different drives is to change the way the numbers get assigned to the disks.
example(how it is just yet):
3 disk drives and one computer in one network:
drive_0
drive_1
dirve_2
computer_0

if i put a disk into "drive_2" it appears as "disk"
put another into "drive_1" you get "disk" and "disk2"
remove the one from "drive_2". now you get only "disk"

you see the disk in "drive_2" is "disk" first.
(but in the last step the disk from "drive_1" is assigned as "disk" too) equals (no identification of disks possible.)

now the example including my idea:

3 disk drives and one computer in one network:
drive_0
drive_1
dirve_2
computer_0

if i put a disk into "drive_2" it appears as "remoteDisk2"
put another into "drive_1" you get "remoteDisk2" and "remoteDisk1"
remove the one from "drive_2". now you get only "remoteDisk1"
the "remote" is just an indicator for a remoteDrive so the solution doesn't cross the directly attached disk drives

additional improvement to the directly attached disk drives were "diskRight", "diskLeft", ect, to identify them as well as in the network

yeah, thats it. if there are any things i missunderstood, pls tell me. but i think there were no cons to these changes i would like to have. if you have other ideas to get better identification you're welcome. i hope my grammar isn't too bad :S I'm from germany.

~InDieTasten
Cloudy #2
Posted 31 March 2013 - 02:01 AM
Won't disk.getMountPath work? That will allow you to link a drive to a folder easy.
BigSHinyToys #3
Posted 31 March 2013 - 02:56 AM
A modification to the dir command to show side or peripheral ID would be a nice touch.
Cloudy #4
Posted 31 March 2013 - 03:41 AM
A modification to the dir command to show side or peripheral ID would be a nice touch.

As I said before you could do that yourself.
InDieTasten #5
Posted 31 March 2013 - 10:24 AM
Won't disk.getMountPath work? That will allow you to link a drive to a folder easy.
that'll work with directly attached disk drives. but there's no way to do it with remote:

wiredModem = peripheral.wrap("modemSide")
mountPth = wiredModem.callRemote("drive_0", "getMountPath") -- isn't available.

as mentioned before, the disk(api) isn't implemented yet in remote:

modem = peripheral.wrap("modemSide")
textutils.serialize(modem.getMehtodsRemote("drive_0")) --returns nil

of course i could create some sort of identifier file on all of these floppies as alternative way. but i think it's not wanted that all apis from other peripherals(monitor, printer) are implemented and the one from the disk drive isn't. maybe dan forgot it or something. because it makes no sense to miss out the disk api over remote.
so it's kind of a bug i think. feel free to move it. or ask dan for it. if it's wanted or not(that there're no remoteMethods for the disk drives)

and wow, thank you for answering so quick.
I want to praise this awesome support and moderating.

~InDieTasten
Cloudy #6
Posted 31 March 2013 - 11:08 AM
Uh… disk.getMountPath will work just the same as local peripherals… the peripheral API transparently sends things via the modem.
InDieTasten #7
Posted 31 March 2013 - 11:43 AM
Uh… disk.getMountPath will work just the same as local peripherals… the peripheral API transparently sends things via the modem.
I'm not sure how i should do this. for disk.getMountPath is a side needed on which the drive is sitting relative to the computer. can i use the local perpheralname("drive_0") as side?
Or the modem side. but then the modem doesn't know which drive.
MudkipTheEpic #8
Posted 31 March 2013 - 11:47 AM
mountPth = wiredModem.callRemote("drive_0", "getMountPath") should work…
Cloudy #9
Posted 31 March 2013 - 12:11 PM
Uh… disk.getMountPath will work just the same as local peripherals… the peripheral API transparently sends things via the modem.
I'm not sure how i should do this. for disk.getMountPath is a side needed on which the drive is sitting relative to the computer. can i use the local perpheralname("drive_0") as side?
Or the modem side. but then the modem doesn't know which drive.

The peripheral name.


mountPth = wiredModem.callRemote("drive_0", "getMountPath") should work…

Why do people insist on complicating things when peripheral.call will do the same job?
InDieTasten #10
Posted 31 March 2013 - 02:07 PM
thx for your support cloudy. you can now close/quit this topic…
for less future suggestions caused by non-knowing of the actual mod the wiki should be more up to date.

~InDieTasten
Cloudy #11
Posted 31 March 2013 - 11:14 PM
thx for your support cloudy. you can now close/quit this topic…
for less future suggestions caused by non-knowing of the actual mod the wiki should be more up to date.

~InDieTasten

The wiki is user edited. The in game help is always up to date.
InDieTasten #12
Posted 01 April 2013 - 04:05 PM
thx for your support cloudy. you can now close/quit this topic…
for less future suggestions caused by non-knowing of the actual mod the wiki should be more up to date.

~InDieTasten

The wiki is user edited. The in game help is always up to date.

well, i think it's easier to learn how the things work over the wiki instead of the ingame help. more structure, links and examples, no need of extra computers just for the help function and stuff. it's a lot faster/easier learning things over the wiki. so it should be updated by people like you as well. i can imagine that you have enough work to do just with the forum, but it would decrease the amount of trash in the forum.
but things start to get a little off-topic so it's your choice to close this or something.

~InDieTasten
Cloudy #13
Posted 02 April 2013 - 12:06 AM
As I say to everyone, if you think the wiki is outdated, update it. The only thing guaranteed to be updated is the in game help.