I developed the following tacit verb as part of a script for copying and
deleting directory trees
http://www.jsoftware.com/jwiki/Scripts/DirectoryTrees
I'm not that keen on all the Caps in there. Can it be cleaned
up/simplified more?
NB.*direxist v check directory(s) exists
direxist=: 'd' e."1 [: > [: , [: ({:"1)
1!:0@(fboxname&>)@(dropPS&.>)@boxopen
direxist 'd:\temp'
1
direxist 'd:\temp\'
1
direxist 'd:\temp';'d:\web';'d:\admin'
1 1 1
direxist 'd:\tmep';'d:\web\';'d:\axdmin'
0 1 0
Referenced functions:
fboxname and boxopen are from the system libraries 'files' & 'stdlib'
respectively.
dropPS=: }:^:(PATHSEP_j_={:) NB. drop trailing path separator
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm