piranna / pyfilesystem

Automatically exported from code.google.com/p/pyfilesystem
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

UnsupportedOperation: seek with fsmount #117

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  fsmount  zip://xxx.zip  /mnt 
2.  i try to cat  /mnt/test.txt 

then i got  an exception  : 
 Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/fs/expose/fuse/fuse_ctypes.py", line 294, in _wrapper_
    return func(*args, **kwargs) or 0
  File "/usr/local/lib/python2.7/dist-packages/fs/expose/fuse/fuse_ctypes.py", line 350, in read
    ret = self.operations('read', path, size, offset, fh)
  File "/usr/local/lib/python2.7/dist-packages/fs/expose/fuse/fuse_ctypes.py", line 497, in __call__
    return getattr(self, op)(*args)
  File "/usr/local/lib/python2.7/dist-packages/fs/expose/fuse/__init__.py", line 100, in wrapper
    res = func(*args,**kwds)
  File "/usr/local/lib/python2.7/dist-packages/fs/errors.py", line 191, in wrapper
    return func(*args,**kwds)
  File "/usr/local/lib/python2.7/dist-packages/fs/expose/fuse/__init__.py", line 249, in read
    file.seek(offset)
UnsupportedOperation: seek

What version of the product are you using? On what operating system?

 pyfilesystem 0.4 , python 2.7.3  @  ubuntu 12.04  x64

Original issue reported on code.google.com by relvig...@gmail.com on 11 May 2012 at 1:30

GoogleCodeExporter commented 9 years ago
Just investigated this... and it's not a problem with fsmount.
The 'problem' is that the ZipExtFile returned by 
http://docs.python.org/library/zipfile.html#zipfile.ZipFile.open doesn't 
support seek - and there'd be no efficient way for ZipExtFile to support it 
either.

However the good news is you can still do what you want with the fscat command, 
e.g.
fscat 'zip://xxx.zip!test.txt'

Original comment by gc...@loowis.durge.org on 16 Aug 2012 at 11:19