Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
27dafa5e
Commit
27dafa5e
authored
Nov 13, 2015
by
Paul Sokolovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unix/modos: Add mkdir().
Dependency of upip.
parent
d8557834
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
unix/modos.c
unix/modos.c
+10
-0
unix/qstrdefsport.h
unix/qstrdefsport.h
+1
-0
No files found.
unix/modos.c
View file @
27dafa5e
...
...
@@ -141,6 +141,15 @@ STATIC mp_obj_t mod_os_getenv(mp_obj_t var_in) {
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
mod_os_getenv_obj
,
mod_os_getenv
);
STATIC
mp_obj_t
mod_os_mkdir
(
mp_obj_t
path_in
)
{
// TODO: Accept mode param
const
char
*
path
=
mp_obj_str_get_str
(
path_in
);
int
r
=
mkdir
(
path
,
0777
);
RAISE_ERRNO
(
r
,
errno
);
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
mod_os_mkdir_obj
,
mod_os_mkdir
);
STATIC
const
mp_map_elem_t
mp_module_os_globals_table
[]
=
{
{
MP_OBJ_NEW_QSTR
(
MP_QSTR___name__
),
MP_OBJ_NEW_QSTR
(
MP_QSTR__os
)
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_stat
),
(
mp_obj_t
)
&
mod_os_stat_obj
},
...
...
@@ -150,6 +159,7 @@ STATIC const mp_map_elem_t mp_module_os_globals_table[] = {
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_system
),
(
mp_obj_t
)
&
mod_os_system_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_unlink
),(
mp_obj_t
)
&
mod_os_unlink_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_getenv
),(
mp_obj_t
)
&
mod_os_getenv_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_mkdir
),(
mp_obj_t
)
&
mod_os_mkdir_obj
},
};
STATIC
MP_DEFINE_CONST_DICT
(
mp_module_os_globals
,
mp_module_os_globals_table
);
...
...
unix/qstrdefsport.h
View file @
27dafa5e
...
...
@@ -42,6 +42,7 @@ Q(statvfs)
Q
(
system
)
Q
(
unlink
)
Q
(
getenv
)
Q
(
mkdir
)
Q
(
ffi
)
Q
(
ffimod
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment