Extract file utils
This commit is contained in:
parent
673e77e003
commit
3a833923c0
|
@ -707,12 +707,7 @@ def run_lxc_download_script(
|
|||
return 0
|
||||
|
||||
|
||||
def stat_chmod(file_path, mode):
|
||||
"""
|
||||
Change mode if file doesn't already have this mode.
|
||||
"""
|
||||
if mode != stat.S_IMODE(os.stat(file_path).st_mode):
|
||||
os.chmod(file_path, mode)
|
||||
from utils.files import stat_chmod
|
||||
|
||||
|
||||
def get_mount_point(path):
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
# SPDX-FileCopyrightText: © 2024 Jip-Hop and the Jailmakers <https://github.com/Jip-Hop/jailmaker>
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-3.0-only
|
||||
|
||||
import os
|
||||
import stat
|
||||
|
||||
|
||||
def stat_chmod(file_path, mode):
|
||||
"""
|
||||
Change mode if file doesn't already have this mode.
|
||||
"""
|
||||
if mode != stat.S_IMODE(os.stat(file_path).st_mode):
|
||||
os.chmod(file_path, mode)
|
Loading…
Reference in New Issue