Here you have a script for mounting USB:
And this is for writing and reading a file from USB:
Code:
part = '/dev/sda1'
if io.exists(part) then
os.execute('mount ' .. part .. ' /mnt')
alert('mount ok')
else
alert('usb disk not found')
end
And this is for writing and reading a file from USB:
Code:
path = '/mnt/'
status = io.exists(path)
io.writefile(path .. 'new.txt', 'This is my new file.')
result = io.readfile(path .. 'new.txt')
log(status, result)