RosettaCodeData/Task/Check-that-file-exists/AWK/check-that-file-exists-1.awk
2023-07-01 13:44:08 -04:00

14 lines
251 B
Awk

@load "filefuncs"
function exists(name ,fd) {
if ( stat(name, fd) == -1)
print name " doesn't exist"
else
print name " exists"
}
BEGIN {
exists("input.txt")
exists("/input.txt")
exists("docs")
exists("/docs")
}