View Single Post
Old 01-01-2016, 07:57 AM   #11
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 583
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by kovidgoyal View Post
os.chmod will only work if you have permission to alter the file's attributes, which on unix depends on the file's owner/group compared to yours and on windows on the phase of the moon. And I wont even start down the rabbit hole of filesystem specific attributes, read the man page for chattr if you like.
But os.chmod() could surely be used as a "best attempt" to make the files readable and writable -- in this case by clearing the Windows read-only attribute. (And I agree, if any filesystem-specific attributes were involved, I would shut my mouth now.)

If using os.chmod() to grant RW permissions failed for a particular setup, no-one would be any worse off, but in many/most cases where:

a) I have RW access to the auto-add directory so I can add files and see if they are still there later,
b) I'm running Calibre from an account which has RW access to the auto-add directory so Calibre can import the files and delete them,
c) I put files in the auto-add directory because I want the files to be imported by Calibre if at all possible, and
d) only the common read/write attributes need setting for this to happen;

... it should work, and then I would be much better off... wouldn't I?

Last edited by Phssthpok; 01-01-2016 at 08:06 AM.
Phssthpok is offline   Reply With Quote