local file = fs.open("file","rb")
file.setPos(256) --# start reading at the 256th byte in the file
local byte256 = file.read()
file.setPos(512) --#start reading at the 512th byte in the file
local byte512 = file.read()
file.close()
andlocal file = fs.open("file","wb")
file.setPos(256) --#start writing at the 256th byte in the file or, if the file is shorter than 256 bytes, throw an error
file.write(127)--#The 256th byte is now 127. The old 256th byte has been replaced.
file.close()
This would be useful in scenarios where you only need to access some of the data in a particularly large file, or need to overwrite a section of a file rather than the whole thing.
it's also particularly useful if you want to RAID floppies in a custom file system that is split up into a single file on each drive
Edited by Geforce Fan, 14 October 2016 - 01:22 AM.











