March 2014 update
This commit is contained in:
parent
09687c4926
commit
a25938f123
1846 changed files with 21876 additions and 5203 deletions
7
Task/Empty-directory/AutoHotkey/empty-directory.ahk
Normal file
7
Task/Empty-directory/AutoHotkey/empty-directory.ahk
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
MsgBox % isDir_empty(A_ScriptDir)?"true":"false"
|
||||
|
||||
isDir_empty(p) {
|
||||
Loop, %p%\* , 1
|
||||
return 0
|
||||
return 1
|
||||
}
|
||||
6
Task/Empty-directory/Clojure/empty-directory.clj
Normal file
6
Task/Empty-directory/Clojure/empty-directory.clj
Normal 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 ".."
|
||||
3
Task/Empty-directory/Common-Lisp/empty-directory.lisp
Normal file
3
Task/Empty-directory/Common-Lisp/empty-directory.lisp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
(defun empty-directory-p (path)
|
||||
(and (null (directory (concatenate 'string path "/*")))
|
||||
(null (directory (concatenate 'string path "/*/")))))
|
||||
14
Task/Empty-directory/REXX/empty-directory.rexx
Normal file
14
Task/Empty-directory/REXX/empty-directory.rexx
Normal 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.*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue