-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
In some cases, e3.fs.sync_tree fails to synchronize the Windows read-only attribute on files. You can reproduce the problem using the following script:
from e3.fs import sync_tree
from e3.os.fs import chmod
chmod("a-wx", "in/foo.txt")
sync_tree("in", "out", delete=True)(It doesn't seem to matter whether delete is True or False.)
This is how I used the script:
poeplau@PAWNEE ~/code/sync_tree
$ mkdir in out
poeplau@PAWNEE ~/code/sync_tree
$ touch {in,out}/foo.txt
poeplau@PAWNEE ~/code/sync_tree
$ ll in out
in:
total 0
drwxrwxr-x+ 1 poeplau None 0 Feb 13 12:14 .
drwxrwxr-x+ 1 poeplau None 0 Feb 13 12:14 ..
-rw-rw-r--+ 1 poeplau None 0 Feb 13 12:14 foo.txt
out:
total 0
drwxrwxr-x+ 1 poeplau None 0 Feb 13 12:14 .
drwxrwxr-x+ 1 poeplau None 0 Feb 13 12:14 ..
-rw-rw-r--+ 1 poeplau None 0 Feb 13 12:14 foo.txt
poeplau@PAWNEE ~/code/sync_tree
$ python sync_tree_test.py
poeplau@PAWNEE ~/code/sync_tree
$ ll in out
in:
total 0
drwxrwxr-x+ 1 poeplau None 0 Feb 13 12:14 .
drwxrwxr-x+ 1 poeplau None 0 Feb 13 12:14 ..
-r--r--r--+ 1 poeplau None 0 Feb 13 12:14 foo.txt
out:
total 0
drwxrwxr-x+ 1 poeplau None 0 Feb 13 12:14 .
drwxrwxr-x+ 1 poeplau None 0 Feb 13 12:14 ..
-rw-rw-r--+ 1 poeplau None 0 Feb 13 12:14 foo.txt
Note how out/foo.txt is still writable after the call to sync_tree. Windows Explorer confirms that the read-only attribute isn't set.
Metadata
Metadata
Assignees
Labels
No labels