You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is better that py7zlib have an API to retrieve file modes.
I've been working for it and PR soon.
And I'd like to propose supporting Unix file mode (rwx)
p7zip on UNIX has an attribute trick to store a file mode, when FILE_ATTRIBUTE_UNIX_EXTENSION bit is set, then store a mode in high 16bit.
// p7zip uses the trick to store posix attributes in high 16 bits
if (ui.Attrib & 0x8000)
{
unsigned st_mode = ui.Attrib >> 16;
// st_mode = 00111;
Here is a proposal of API design.
f = fp.getmember(name)
if f.is_executable():
print("%s is an executable" % name)
if f.is_readonly():
print("%s is a read only file" % name)
There are some design issue that how it should be in Windows platform.
A question is whether it checks unix attribute extension only on Unix/Linux/Mac, or always checks it on any platform.
The text was updated successfully, but these errors were encountered:
It also should support symbolic link.
There is a stat module in python which handle file modes and formats, we can help user to use stat.ISLINK(mode) to check archive file formats.
miurahr
changed the title
Feature: py7zlib: file mode detection API
Feature: py7zlib: archive file mode and format API
Mar 28, 2019
It is better that py7zlib have an API to retrieve file modes.
I've been working for it and PR soon.
And I'd like to propose supporting Unix file mode (rwx)
p7zip on UNIX has an attribute trick to store a file mode, when FILE_ATTRIBUTE_UNIX_EXTENSION bit is set, then store a mode in high 16bit.
https://github.com/warexify/p7zip/blob/master/CPP/7zip/Archive/7z/7zUpdate.cpp#L882
Here is a proposal of API design.
There are some design issue that how it should be in Windows platform.
A question is whether it checks unix attribute extension only on Unix/Linux/Mac, or always checks it on any platform.
The text was updated successfully, but these errors were encountered: