Add chmod() that uses Python lib functions
This commit is contained in:
parent
7c8bedcb4a
commit
2003329e0e
1 changed files with 8 additions and 0 deletions
|
|
@ -369,6 +369,14 @@ class Shell:
|
||||||
destination += os.sep + os.path.basename(source)
|
destination += os.sep + os.path.basename(source)
|
||||||
shutil.copy(source, destination)
|
shutil.copy(source, destination)
|
||||||
|
|
||||||
|
def chmod(self, location, mode):
|
||||||
|
"""
|
||||||
|
Change the permissions of a file or directory
|
||||||
|
"""
|
||||||
|
location = self.path(location)
|
||||||
|
if os.path.exists(location):
|
||||||
|
os.chmod(location, mode)
|
||||||
|
|
||||||
def remove(self, location):
|
def remove(self, location):
|
||||||
"""
|
"""
|
||||||
Remove a file or directory if it exists
|
Remove a file or directory if it exists
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue