Add Path.open.
This commit is contained in:
parent
3abd141d5d
commit
c6d7450028
1 changed files with 4 additions and 1 deletions
|
@ -199,6 +199,9 @@ class Path:
|
||||||
norm = norm.replace('/', self.sep).replace('\\', self.sep)
|
norm = norm.replace('/', self.sep).replace('\\', self.sep)
|
||||||
return norm
|
return norm
|
||||||
|
|
||||||
|
def open(self, *args, **kwargs):
|
||||||
|
return open(self.absolute_path, *args, **kwargs)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def parent(self):
|
def parent(self):
|
||||||
parent = os.path.dirname(self.absolute_path)
|
parent = os.path.dirname(self.absolute_path)
|
||||||
|
@ -269,7 +272,7 @@ class Path:
|
||||||
try:
|
try:
|
||||||
os.utime(self.absolute_path)
|
os.utime(self.absolute_path)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
open(self.absolute_path, 'a').close()
|
self.open('a').close()
|
||||||
|
|
||||||
def walk(self):
|
def walk(self):
|
||||||
directories = []
|
directories = []
|
||||||
|
|
Loading…
Reference in a new issue