Check that file exists: Difference between revisions

Content added Content deleted
m (→‎{{header|Stata}}: stored as string, would be an error without the macro quotes)
Line 1,041: Line 1,041:


=={{header|I}}==
=={{header|I}}==
<lang i>function exists(""filename) {
<lang i>concept exists(path) {
var file = open(filename)
open(path)
issues {
errors {
if error.DoesNotExist()
print(filename+" does not exist")
print(path, " does not exist!")
end
return
return
}
}
print(filename+" exists")
print(path, " exists!")
close(file)
}
}


Line 1,056: Line 1,057:
exists("docs")
exists("docs")
exists("/docs")
exists("/docs")
exists("docs/Abdu'l-Bahá.txt")
}</lang>
}</lang>