Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add simple form of mkdir.
  • Loading branch information
colomon committed Oct 23, 2011
1 parent 5d1ba41 commit 8b9e1af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Builtins.cs
Expand Up @@ -1519,6 +1519,10 @@ class SubstrLValue: Variable {
File.Delete(path);
}

public static void path_mkdir(string path) {
Directory.CreateDirectory(path);
}

public static bool emulate_eaccess(string path, int mode) {
uint ruid = PosixWrapper.getuid();
uint rgid = PosixWrapper.getgid();
Expand Down
5 changes: 5 additions & 0 deletions lib/CORE.setting
Expand Up @@ -2108,6 +2108,11 @@ sub unlink(*@filenames) is unsafe {
True; # is there a way to actually detect problems with File.Delete?
}
sub mkdir($filename) is unsafe {
Q:CgOp { (rnull (path_mkdir (obj_getstr {$filename}))) };
True; # is there a way to actually detect problems with File.Delete?
}
multi sub open($filename, :$w?, :$a?) is unsafe {
if $a {
Q:CgOp { (box TextWriter (twriter_append (obj_getstr {$filename}) (obj_getbool {True}))) }
Expand Down

0 comments on commit 8b9e1af

Please sign in to comment.