Add Pathclass.touch.
This commit is contained in:
parent
35eec077ed
commit
13f19719b2
1 changed files with 6 additions and 0 deletions
|
@ -241,6 +241,12 @@ class Path:
|
||||||
def stat(self):
|
def stat(self):
|
||||||
return os.stat(self.absolute_path)
|
return os.stat(self.absolute_path)
|
||||||
|
|
||||||
|
def touch(self):
|
||||||
|
try:
|
||||||
|
os.utime(self.absolute_path)
|
||||||
|
except FileNotFoundError:
|
||||||
|
open(self.absolute_path, 'a').close()
|
||||||
|
|
||||||
def walk(self):
|
def walk(self):
|
||||||
directories = []
|
directories = []
|
||||||
for child in self.listdir():
|
for child in self.listdir():
|
||||||
|
|
Loading…
Reference in a new issue