mirror of
https://github.com/platomav/BIOSUtilities.git
synced 2025-05-13 06:34:42 -04:00
Added Apple EFI Package Extractor v2.0_a4
Added Apple EFI PBZX Extractor v1.0_a4 Updated Apple EFI Image Identifier v2.0_a4 Updated Apple EFI IM4P Splitter v3.0_a4 Updated Insyde iFlash/iFdPacker Extractor v2.0_a10 Improved 7-Zip parameter control
This commit is contained in:
parent
389c30bb65
commit
0e170334c6
9 changed files with 482 additions and 20 deletions
|
@ -71,6 +71,10 @@ def agnostic_path(in_path):
|
|||
def path_parent(in_path):
|
||||
return Path(in_path).parent.absolute()
|
||||
|
||||
# Get final path component, with suffix
|
||||
def path_name(in_path):
|
||||
return PurePath(in_path).name
|
||||
|
||||
# Get final path component, w/o suffix
|
||||
def path_stem(in_path):
|
||||
return PurePath(in_path).stem
|
||||
|
@ -95,6 +99,13 @@ def del_dirs(in_path):
|
|||
if Path(in_path).is_dir():
|
||||
shutil.rmtree(in_path, onerror=clear_readonly)
|
||||
|
||||
# Copy file to path with or w/o metadata
|
||||
def copy_file(in_path, out_path, meta=False):
|
||||
if meta:
|
||||
shutil.copy2(in_path, out_path)
|
||||
else:
|
||||
shutil.copy(in_path, out_path)
|
||||
|
||||
# Clear read-only file attribute (on shutil.rmtree error)
|
||||
def clear_readonly(in_func, in_path, _):
|
||||
os.chmod(in_path, stat.S_IWRITE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue