-- drive2: a better version of /rom/programs/drive, able to detect disk drives. -- written by aj/freem. local tArgs = {...} local sPath = shell.dir() if tArgs[1] ~= nil then sPath = shell.resolve(tArgs[1]) end -- todo: some error checking, namely to see if the "/disk*" dir exists if fs.exists(sPath) then sPath = "/"..sPath local driveType = fs.getDrive(sPath) local realType = "" if driveType == "hdd" then -- it may say "hdd", but we can't really be sure. if string.find(sPath,"/disk[1-5]?") then for k,v in pairs(rs.getSides()) do if peripheral.isPresent(v) and peripheral.getType(v) == "drive" then if disk.getMountPath(v) then if "/"..disk.getMountPath(v) == sPath then realType = string.format("disk (%s)",v) end end end end else -- we can trust it, for now. realType = driveType end else -- we can trust it realType = driveType end print(realType) else print("No such path") end