24.03.2017, 16:19
I already changed it, but I still get the error, when I put mountusb ('/ mnt') the status is USB ok but it is not taking the USB.
With this code I also get error, I do not know what else to try.
<code>
function mountusb(part, mnt)
part = part or '/dev/sda1'
mnt = mnt or '/mnt'
local cmd = string.format('mount %q %q 2>&1', part, mnt)
local res, stat = io.readproc(cmd)
return stat == 0 and true or nil, res
end
res, err = mountusb('/dev/sda')
if res then
alert('USB OK')
else
alert('USB error: ' .. tostring(err))
end
</code>
With this code I also get error, I do not know what else to try.
<code>
function mountusb(part, mnt)
part = part or '/dev/sda1'
mnt = mnt or '/mnt'
local cmd = string.format('mount %q %q 2>&1', part, mnt)
local res, stat = io.readproc(cmd)
return stat == 0 and true or nil, res
end
res, err = mountusb('/dev/sda')
if res then
alert('USB OK')
else
alert('USB error: ' .. tostring(err))
end
</code>