Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
dc905f08
Commit
dc905f08
authored
Feb 18, 2016
by
Terry Ellison
Browse files
Merge pull request #1063 from DiUS/fscfg
Add file.fscfg() command for fs location + size.
parents
1afa72d5
1fd98d9f
Changes
2
Show whitespace changes
Inline
Side-by-side
app/modules/file.c
View file @
dc905f08
...
@@ -307,6 +307,13 @@ static int file_writeline( lua_State* L )
...
@@ -307,6 +307,13 @@ static int file_writeline( lua_State* L )
return
1
;
return
1
;
}
}
static
int
file_fscfg
(
lua_State
*
L
)
{
lua_pushinteger
(
L
,
fs
.
cfg
.
phys_addr
);
lua_pushinteger
(
L
,
fs
.
cfg
.
phys_size
);
return
2
;
}
// Module function map
// Module function map
static
const
LUA_REG_TYPE
file_map
[]
=
{
static
const
LUA_REG_TYPE
file_map
[]
=
{
{
LSTRKEY
(
"list"
),
LFUNCVAL
(
file_list
)
},
{
LSTRKEY
(
"list"
),
LFUNCVAL
(
file_list
)
},
...
@@ -323,6 +330,7 @@ static const LUA_REG_TYPE file_map[] = {
...
@@ -323,6 +330,7 @@ static const LUA_REG_TYPE file_map[] = {
{
LSTRKEY
(
"flush"
),
LFUNCVAL
(
file_flush
)
},
{
LSTRKEY
(
"flush"
),
LFUNCVAL
(
file_flush
)
},
{
LSTRKEY
(
"rename"
),
LFUNCVAL
(
file_rename
)
},
{
LSTRKEY
(
"rename"
),
LFUNCVAL
(
file_rename
)
},
{
LSTRKEY
(
"fsinfo"
),
LFUNCVAL
(
file_fsinfo
)
},
{
LSTRKEY
(
"fsinfo"
),
LFUNCVAL
(
file_fsinfo
)
},
{
LSTRKEY
(
"fscfg"
),
LFUNCVAL
(
file_fscfg
)
},
{
LSTRKEY
(
"exists"
),
LFUNCVAL
(
file_exists
)
},
{
LSTRKEY
(
"exists"
),
LFUNCVAL
(
file_exists
)
},
#endif
#endif
{
LNILKEY
,
LNILVAL
}
{
LNILKEY
,
LNILVAL
}
...
...
docs/en/modules/file.md
View file @
dc905f08
...
@@ -99,6 +99,25 @@ none
...
@@ -99,6 +99,25 @@ none
#### See also
#### See also
[
`file.remove()`
](
#fileremove
)
[
`file.remove()`
](
#fileremove
)
## file.fscfg ()
Returns the flash address and physical size of the file system area, in bytes.
#### Syntax
`file.fscfg()`
#### Parameters
none
#### Returns
-
`flash address`
(number)
-
`size`
(number)
#### Example
```
lua
print
(
string.format
(
"0x%x"
,
file
.
fscfg
()))
```
## file.fsinfo()
## file.fsinfo()
Return size information for the file system, in bytes.
Return size information for the file system, in bytes.
...
...
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