Jump to content

Empty directory: Difference between revisions

→‎{{header|J}}: reference correct Foreign
No edit summary
(→‎{{header|J}}: reference correct Foreign)
Line 102:
=={{header|J}}==
 
<lang j>require 'dir'
empty_dir=: 0 = '/*' #@dir@,~ ]</lang>
 
In other words, list the contents of the directory, count how many items are in it, and test if that count was zero.
 
Note that <code>1!:10</code> could have been used here, instead of the <code>dir</code> cover.
 
Example, under windows, create some directories using cygwin:
892

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.