RosettaCodeData/Task/Check-that-file-exists/AWK/check-that-file-exists-1.awk
2015-11-18 06:14:39 +00:00

14 lines
251 B
Awk

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