Check that file exists: Difference between revisions

 
(One intermediate revision by the same user not shown)
Line 1,948:
=={{header|langur}}==
The prop() function returns a hash of file/directory properties.
<syntaxhighlight lang="langur">val .printresult = impure fn(.file) {
write .file, ": "
if val .p = prop(.file) {
if .p'isdir {
writeln "is directory"
} else {
Line 1,961:
}
 
.printresult( "input.txt")
.printresult( "/input.txt")
.printresult( "docs")
.printresult( "/docs")
</syntaxhighlight>
 
1,007

edits