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

Option 'force' issues write protection on updated file #23

Open
tkhyn opened this issue Aug 15, 2019 · 2 comments
Open

Option 'force' issues write protection on updated file #23

tkhyn opened this issue Aug 15, 2019 · 2 comments
Labels
bug Something isn't working major

Comments

@tkhyn
Copy link
Owner

tkhyn commented Aug 15, 2019

Original report by Anonymous.


Hi there,

the option 'force' switches the write protection on for the synced file if it allready existed in the destination folder (but with an older timestamp).
That means that the copied file in the dest-folder is now write protected and cant be overwriten the next time the content/timestamp changes.

Hope i was somehow clear :)

I just disabled force and now the sync of updated files works now

i guess its this line:
syncer.py : 404
OS: Windows 10

Thanks for the work!

@tkhyn
Copy link
Owner Author

tkhyn commented Aug 18, 2019

Yes, that is somehow clear. I am not sure how I would solve the problem though. Line 404 comes from the original codebase I forked dirsync from, and I would have to dig to find out what to replace the 1638 with.

I would gladly accept a PR to resolve the issue though.

@tkhyn tkhyn added major bug Something isn't working labels Feb 6, 2020
@sleeperpservice
Copy link

I ran into this. Thanks for the force switch help.

On Windows10 Python 3.7. dirsync 2.2.4 final

#404 os.chmod(file2, 1638) # 1638 = 0o666

os.chmod(file2, 1638) - sets the Windows Read-Only attribute to True
os.chmod(file2, 0o666) - sets the attribute to False

I'm guessing in this case we want it to be False if we want to force it so we can overwrite it.

As read elsewhere chmod does not do much in Windows apart from setting that flag.

I am not an expert on this especially on other operating systems so would not want to do a PR to fix what would be a windows only issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working major
Projects
None yet
Development

No branches or pull requests

2 participants