Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
c55d06ed
Commit
c55d06ed
authored
Dec 23, 2016
by
Deomid Ryabkov
Committed by
Cesanta Bot
Dec 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add directory listing support ot ESP32
PUBLISHED_FROM=336d6b28d6165ece75d25911058ffdd075a3c191
parent
38298735
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
mongoose.c
mongoose.c
+13
-5
No files found.
mongoose.c
View file @
c55d06ed
...
@@ -587,6 +587,10 @@ typedef struct DIR {
...
@@ -587,6 +587,10 @@ typedef struct DIR {
}
DIR
;
}
DIR
;
#endif
#endif
#if CS_ENABLE_SPIFFS
extern
spiffs
*
cs_spiffs_get_fs
(
void
);
#endif
#if defined(_WIN32) || CS_ENABLE_SPIFFS
#if defined(_WIN32) || CS_ENABLE_SPIFFS
DIR
*
opendir
(
const
char
*
dir_name
);
DIR
*
opendir
(
const
char
*
dir_name
);
int
closedir
(
DIR
*
dir
);
int
closedir
(
DIR
*
dir
);
...
@@ -694,10 +698,14 @@ struct dirent *readdir(DIR *dir) {
...
@@ -694,10 +698,14 @@ struct dirent *readdir(DIR *dir) {
DIR
*
opendir
(
const
char
*
dir_name
)
{
DIR
*
opendir
(
const
char
*
dir_name
)
{
DIR
*
dir
=
NULL
;
DIR
*
dir
=
NULL
;
extern
spiffs
fs
;
spiffs
*
fs
=
cs_spiffs_get_fs
();
if
(
dir_name
==
NULL
||
fs
==
NULL
||
(
dir
=
(
DIR
*
)
calloc
(
1
,
sizeof
(
*
dir
)))
==
NULL
)
{
return
NULL
;
}
if
(
dir_name
!=
NULL
&&
(
dir
=
(
DIR
*
)
malloc
(
sizeof
(
*
dir
)))
!=
NULL
&&
if
(
SPIFFS_opendir
(
fs
,
dir_name
,
&
dir
->
dh
)
==
NULL
)
{
SPIFFS_opendir
(
&
fs
,
(
char
*
)
dir_name
,
&
dir
->
dh
)
==
NULL
)
{
free
(
dir
);
free
(
dir
);
dir
=
NULL
;
dir
=
NULL
;
}
}
...
@@ -720,14 +728,14 @@ struct dirent *readdir(DIR *dir) {
...
@@ -720,14 +728,14 @@ struct dirent *readdir(DIR *dir) {
/* SPIFFs doesn't support directory operations */
/* SPIFFs doesn't support directory operations */
int
rmdir
(
const
char
*
path
)
{
int
rmdir
(
const
char
*
path
)
{
(
void
)
path
;
(
void
)
path
;
return
ENOT
DIR
;
return
ENOT
SUP
;
}
}
int
mkdir
(
const
char
*
path
,
mode_t
mode
)
{
int
mkdir
(
const
char
*
path
,
mode_t
mode
)
{
(
void
)
path
;
(
void
)
path
;
(
void
)
mode
;
(
void
)
mode
;
/* for spiffs supports only root dir, which comes from mongoose as '.' */
/* for spiffs supports only root dir, which comes from mongoose as '.' */
return
(
strlen
(
path
)
==
1
&&
*
path
==
'.'
)
?
0
:
ENOT
DIR
;
return
(
strlen
(
path
)
==
1
&&
*
path
==
'.'
)
?
0
:
ENOT
SUP
;
}
}
#endif
/* CS_ENABLE_SPIFFS */
#endif
/* CS_ENABLE_SPIFFS */
...
...
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