Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
|
|
@ -0,0 +1 @@
|
|||
(ensure-directories-exist "your/path/name")
|
||||
|
|
@ -0,0 +1 @@
|
|||
File.mkdir_p("./path/to/dir")
|
||||
7
Task/Make-directory-path/Haskell/make-directory-path.hs
Normal file
7
Task/Make-directory-path/Haskell/make-directory-path.hs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import System.Directory (createDirectory, setCurrentDirectory)
|
||||
import Data.List.Split (splitOn)
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
let path = splitOn "/" "path/to/dir"
|
||||
mapM_ (\x -> createDirectory x >> setCurrentDirectory x) path
|
||||
2
Task/Make-directory-path/J/make-directory-path-1.j
Normal file
2
Task/Make-directory-path/J/make-directory-path-1.j
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
require 'general/dirutils'
|
||||
pathcreate '/tmp/some/path/to/dir'
|
||||
17
Task/Make-directory-path/J/make-directory-path-2.j
Normal file
17
Task/Make-directory-path/J/make-directory-path-2.j
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
pathcreate=: monad define
|
||||
todir=. termsep_j_ jpathsep y
|
||||
todirs=. }. ,each /\ <;.2 todir NB. base dirs
|
||||
msk=. -.direxist todirs NB. 1 for each non-existing dir
|
||||
msk=. 0 (i. msk i: 0)}msk
|
||||
dircreate msk#todirs NB. create non-existing base dirs
|
||||
)
|
||||
|
||||
dircreate=: monad define
|
||||
y=. boxxopen y
|
||||
msk=. -.direxist y
|
||||
if. ''-:$msk do. msk=. (#y)#msk end.
|
||||
res=. 1!:5 msk#y
|
||||
msk #inv ,res
|
||||
)
|
||||
|
||||
direxist=: 2 = ftype&>@:boxopen
|
||||
|
|
@ -1 +1 @@
|
|||
mkdir 'path/to/dir'
|
||||
mkpath 'path/to/dir'
|
||||
|
|
|
|||
3
Task/Make-directory-path/Perl/make-directory-path.pl
Normal file
3
Task/Make-directory-path/Perl/make-directory-path.pl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
use File::Path qw(make_path);
|
||||
|
||||
make_path('path/to/dir')
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
$ include "seed7_05.s7i";
|
||||
include "cli_cmds.s7i";
|
||||
|
||||
const proc: main is func
|
||||
begin
|
||||
doMkdirCmd(argv(PROGRAM), TRUE);
|
||||
end func;
|
||||
10
Task/Make-directory-path/Seed7/make-directory-path-2.seed7
Normal file
10
Task/Make-directory-path/Seed7/make-directory-path-2.seed7
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
$ include "seed7_05.s7i";
|
||||
include "cli_cmds.s7i";
|
||||
|
||||
const proc: main is func
|
||||
local
|
||||
var string: parameters is "";
|
||||
begin
|
||||
parameters := join(argv(PROGRAM), " ");
|
||||
doMkdir(parameters);
|
||||
end func;
|
||||
Loading…
Add table
Add a link
Reference in a new issue