IPWorks ZIP 2020 Python Edition

Questions / Feedback?

file_permissions Property

This property contains the UNIX permissions of the file, as stored in the tar archive.

Syntax

def get_file_permissions(file_index: int) -> str: ...
def set_file_permissions(file_index: int, value: str) -> None: ...

Default Value

"644"

Remarks

This property contains the UNIX permissions of the file, as stored in the tar archive. It will be written to the tar archive during compression. As native code is not used, permissions are read from and written to the tar archive only, and not to the file system.

The value should be specified as a string of three characters, representing the owner's permissions, the group's permissions, and others' permissions. Each character should be a bitmask of 4 (read access), 2 (write access), or 1 (executable access), as in chmod.

In Java, if the SetFilePermissions configuration setting is set to true, the class will shell out an instance of chmod for each file, and will attempt to set the file permissions to those specified in file_permissions. Obviously, this functionality is operating system dependent and will fail in Windows in particular; it may also fail in other operating systems for a variety of reasons.

The file_index parameter specifies the index of the item in the array. The size of the array is controlled by the file_count property.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks ZIP 2020 Python Edition - Version 20.0 [Build 8300]