Skip to content

Commit 2003329

Browse files
committed
Add chmod() that uses Python lib functions
1 parent 7c8bedc commit 2003329

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

adafruit_shell.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,14 @@ def copy(self, source, destination):
369369
destination += os.sep + os.path.basename(source)
370370
shutil.copy(source, destination)
371371

372+
def chmod(self, location, mode):
373+
"""
374+
Change the permissions of a file or directory
375+
"""
376+
location = self.path(location)
377+
if os.path.exists(location):
378+
os.chmod(location, mode)
379+
372380
def remove(self, location):
373381
"""
374382
Remove a file or directory if it exists

0 commit comments

Comments
 (0)