New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mkdir() function #1219
Comments
From @carbinThis is a basic patch to add a mkdir function. The (optional) mode Let me know if there is anything wrong with this or something that I Thanks. -- |
From @carbin0001-Add-mkdir-method.patchFrom e108c3a56d172d05cea79ad9a79c81edb26c289c Mon Sep 17 00:00:00 2001
From: carlin <carlin-public@theintersect.org>
Date: Tue, 11 Aug 2009 02:27:58 +1200
Subject: [PATCH] Add mkdir() method
Error handling fix
---
src/builtins/io.pir | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/src/builtins/io.pir b/src/builtins/io.pir
index 77fd0b5..7efa108 100644
--- a/src/builtins/io.pir
+++ b/src/builtins/io.pir
@@ -174,6 +174,29 @@ true value is returned.
.tailcall '!FAIL'('Unable to change to directory "', newdir, '"')
.end
+.sub 'mkdir'
+ .param string dirname
+ .param int dirmode :optional
+
+ if dirmode goto make
+ # Be permissive by default, as per reasoning in perldoc -f mkdir
+ dirmode = 0o777
+
+ make:
+ .local pmc os
+ os = root_new ['parrot';'OS']
+ push_eh failure
+ os.'mkdir'(dirname,dirmode)
+ pop_eh
+ $P0 = get_hll_global ['Bool'], 'True'
+ .return ($P0)
+
+ failure:
+ pop_eh
+ .tailcall '!FAIL'('Unable to create directory "', dirname, '"')
+.end
+
+
=back
=cut
--
1.6.0.4
|
From @carbinSeems this was done in c4e6d0fa19bec03b7417b5ba743aefb18e6fcdad using a |
@carbin - Status changed from 'new' to 'resolved' |
Migrated from rt.perl.org#68402 (status was 'resolved')
Searchable as RT68402$
The text was updated successfully, but these errors were encountered: