Skip to content

Commit 1dc42c6

Browse files
committed
Add ReadTarFS.islink method using TarInfo.issym method directly
1 parent 2cdc9af commit 1dc42c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/tarfs.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,13 @@ def isfile(self, path):
389389
except KeyError:
390390
return False
391391

392+
def islink(self, path):
393+
_path = relpath(self.validatepath(path))
394+
try:
395+
return self._directory_entries[_path].issym()
396+
except KeyError:
397+
return False
398+
392399
def setinfo(self, path, info):
393400
# type: (Text, RawInfo) -> None
394401
self.check()

0 commit comments

Comments
 (0)