parse arg d; if \CheckDirectoryExists(d) then do; if \CheckDirectoryExists(d || "\..") then call MakePath d || "\.."; call SysMkDir d; end; return
DeletePath: procedure
parse arg d; call SysFileTree d || "\*", "e", "FO"; do i = 1 to e.0; call SysFileDelete e.i; end; call SysFileTree d || "\*", "e", "DO"; do i = 1 to e.0; call DeletePath e.i; end; call SysRmDir d; return
ExtractAttachedFile: procedure
parse arg a; parse source . . s; call stream s, "c", "open read"; do while lines(s); l = linein(s); if left(l, 20) = "Content-Disposition:" then do; call linein s; call SysFileDelete a; call stream a, "c", "open write"; f = xrange("A", "Z") || xrange("a", "z") || xrange("0", "9") || "+/"; t = xrange("00"x, "3f"x); do while lines(s); l = linein(s); if left(l, 2) = "*/" then leave; v = translate(l, t, f); r = ""; do i = 1 to length(v); r = r || substr(x2b(c2x(substr(v, i, 1))), 3); end; call charout a, x2c(b2x(left(r, length(r) % 8 * 8))); end; call stream a, "c", "close"; call stream s, "c", "close"; return 1; end; end; call stream s, "c", "close"; return 0
ParseCatalogList: procedure
parse arg c, s, d; do while lines(c); l = linein(c); parse var l v t; select; when v = "COPY" then '@copy "' || s || '\' || t || '" "' || d || '\' || t || '" >nul 2>nul'; when v = "UNLOCK" then '@"' || s || '\unlock" "' || d || '\' || t || '"'; when v = "MKDIR" then call SysMkDir d || '\' || t; otherwise end; end; call stream c, "c", "close"; return