Patch to set file permissions for backups

Nathan Hjelm <[email protected]>
Newsgroups gmane.comp.mobile.bitpim.devel
Message-ID <[email protected]>
This patch sets the permissions of files contained in new backups to rw------- for files instead of no access. It might be a good idea, in the future, to set the file permissions as they are set on the phone. That way when restoring files to the phone it is possible to preserve permissions (not sure if there is any reason to preserve permissions).

-Nathan

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
BitPim-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
backup_perms.diff (application/octet-stream, 674 B)
Index: src/gui.py
===================================================================
--- src/gui.py	(revision 4635)
+++ src/gui.py	(working copy)
@@ -2142,6 +2142,9 @@
                         zi.date_time=(0,0,0,0,0,0)
                     else:
                         zi.date_time=time.gmtime(files[k]['date'][0])[:6]
+                    # set UNIX file permissions and flags (file flag and rw-------)
+                    # might be a good idea to use the permissions from the phone
+                    zi.external_attr = 0x81800000L
                     zi.compress_type=zipfile.ZIP_DEFLATED
                     zip.writestr(zi, contents)
                 except:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.