March 2014 update

This commit is contained in:
Ingy döt Net 2014-04-02 16:56:35 +00:00
parent 09687c4926
commit a25938f123
1846 changed files with 21876 additions and 5203 deletions

View file

@ -0,0 +1,7 @@
MsgBox % isDir_empty(A_ScriptDir)?"true":"false"
isDir_empty(p) {
Loop, %p%\* , 1
return 0
return 1
}

View file

@ -0,0 +1,6 @@
(require '[clojure.java.io :as io])
(defn empty-dir? [path]
(let [file (io/file path)]
(assert (.exists file))
(assert (.isDirectory file))
(-> file .list empty?))) ; .list ignores "." and ".."

View file

@ -0,0 +1,3 @@
(defun empty-directory-p (path)
(and (null (directory (concatenate 'string path "/*")))
(null (directory (concatenate 'string path "/*/")))))

View file

@ -0,0 +1,14 @@
/*REXX pgm checks to see if a directory is empty; if not, lists entries.*/
parse arg xdir; if xdir='' then xdir='\someDir' /*Any DIR? Use default.*/
@.=0 /*default in case ADDRESS fails. */
trace off /*suppress REXX err msg for fails*/
address system 'DIR' xdir '/b' with output stem @. /*issue the DIR cmd.*/
if rc\==0 then do /*an error happened?*/
say '***error!*** from DIR' xDIR /*indicate que pasa.*/
say 'return code=' rc /*show the ret Code.*/
exit rc /*exit with the RC.*/
end /* [↑] bad address.*/
#=@.rc /*number of entries.*/
if #==0 then #=' no ' /*use a word, ¬zero.*/
say center('directory ' xdir " has " # ' entries.',79,'')
exit @.0+rc /*stick a fork in it, we're done.*/