Commit e1abb906 authored by Merlijn Wajer's avatar Merlijn Wajer
Browse files

metadata: copy mode from existing _meta.xml

parent daf4a88a
from os import rename, stat, remove, fsync, posix_fadvise, \ from os import rename, stat, remove, fsync, posix_fadvise, \
POSIX_FADV_DONTNEED, chmod, close POSIX_FADV_DONTNEED, chmod, close, stat
from os.path import join from os.path import join
from tempfile import mkstemp from tempfile import mkstemp
...@@ -130,8 +130,10 @@ def write_item_metadata(identifier, metadata): ...@@ -130,8 +130,10 @@ def write_item_metadata(identifier, metadata):
remove(tmp_path) remove(tmp_path)
raise raise
chmod(tmp_path, 0o644) meta_xml_path = join(PB_ITEM, '%s_meta.xml' % identifier)
rename(tmp_path, join(PB_ITEM, '%s_meta.xml' % identifier)) st = stat(meta_xml_path)
chmod(tmp_path, st.st_mode)
rename(tmp_path, meta_xml_path)
def load_files_metadata(identifier): def load_files_metadata(identifier):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment