ubidump icon indicating copy to clipboard operation
ubidump copied to clipboard

Error on extract files on windows 7

Open july008 opened this issue 4 years ago • 1 comments

c:\ubidumptest\ubidump.py -s 12 1.ubifs ERROR 'module' object has no attribute 'symlink'

When decompressing the ubifs file on the windows system, the creation fails because the windows system does not have symlink

change elif typ == inode.ITYPE_SYMLINK: os.symlink(inode.data, fullpath)

to import platform

            elif typ == inode.ITYPE_SYMLINK:
                if(platform.system()=='Windows'):
                    print("create symlink %s" % fullpath)
                    open(fullpath+'_symlink', 'wb').write('symlink to fullpath')
                else:
                    os.symlink(inode.data, fullpath)  

You can continue to unzip the file

july008 avatar Nov 14 '20 01:11 july008

Ah, thanks, i will wrap os.symlink in an exception handler. And, btw, I noticed os.symlink is only missing on windows in python2

nlitsme avatar Nov 14 '20 08:11 nlitsme