tools/mpremote: Implement seek and flush in ioctl method.
Fixes issue #8058. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
9ffb1ad2f8
commit
67f66795c0
|
@ -142,7 +142,13 @@ class RemoteFile(uio.IOBase):
|
|||
self.close()
|
||||
|
||||
def ioctl(self, request, arg):
|
||||
if request == 4: # CLOSE
|
||||
if request == 1: # FLUSH
|
||||
self.flush()
|
||||
elif request == 2: # SEEK
|
||||
# This assumes a 32-bit bare-metal machine.
|
||||
import machine
|
||||
machine.mem32[arg] = self.seek(machine.mem32[arg], machine.mem32[arg + 4])
|
||||
elif request == 4: # CLOSE
|
||||
self.close()
|
||||
return 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue