Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on extract files on windows 7 #15

Open
july008 opened this issue Nov 14, 2020 · 1 comment
Open

Error on extract files on windows 7 #15

july008 opened this issue Nov 14, 2020 · 1 comment

Comments

@july008
Copy link

july008 commented Nov 14, 2020

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

@nlitsme
Copy link
Owner

nlitsme commented Nov 14, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants