Skip to content

Commit 72663a7

Browse files
Boshra MahmoudiBoshra Mahmoudi
authored andcommitted
add another check to separate existing files from nonexistent paths
1 parent d193496 commit 72663a7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • implement-shell-tools/ls

‎implement-shell-tools/ls/ls.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@
2929
print(file, end=" ")
3030
print()
3131

32+
elif os.path.isfile(path):
33+
print(path)
34+
3235
else:
33-
print(path)
36+
print(f"{path}: No such file or directory")

0 commit comments

Comments
 (0)