Check that file exists: Difference between revisions

Content added Content deleted
(add RPL)
m (→‎{{header|Wren}}: Changed to Wren S/H)
Line 3,211: Line 3,211:


Since in Linux an ''empty'' directory has a size of 4K bytes, we check the number of files it contains to confirm that it's empty.
Since in Linux an ''empty'' directory has a size of 4K bytes, we check the number of files it contains to confirm that it's empty.
<syntaxhighlight lang="ecmascript">import "io" for Directory, File
<syntaxhighlight lang="wren">import "io" for Directory, File


for (name in ["input.txt", "`Abdu'l-Bahá.txt"]) {
for (name in ["input.txt", "`Abdu'l-Bahá.txt"]) {
Line 3,236: Line 3,236:
docs directory exists and contains 0 files.
docs directory exists and contains 0 files.
</pre>
</pre>

=={{header|XPL0}}==
=={{header|XPL0}}==
Attempting to open a non-existent file or directory will cause an error.
Attempting to open a non-existent file or directory will cause an error.