Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
a1cdcb3d
...
a1cdcb3d53d87ad3cd24fa5909752a90806fa693
authored
2001-06-25 08:15:41 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
A (very rudimentary) implementation.
1 parent
ac2f982e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
3 deletions
mail/folders.c
mail/folders.c
View file @
a1cdcb3
...
...
@@ -16,6 +16,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "mail.h"
#include <dirent.h>
/*
* folders
...
...
@@ -24,7 +25,37 @@
int
mail_folders
(
int
argc
,
char
**
argv
)
{
fprintf
(
ofile
,
"Function not implemented in %s line %d
\n
"
,
__FILE__
,
__LINE__
);
return
1
;
DIR
*
dir
;
struct
dirent
*
dirent
;
char
*
path
;
struct
mail_env_entry
*
env
=
util_find_env
(
"folder"
);
if
(
!
env
->
set
)
{
fprintf
(
ofile
,
"No value set for
\"
folder
\"\n
"
);
return
1
;
}
path
=
util_fullpath
(
env
->
value
);
dir
=
opendir
(
path
);
if
(
!
dir
)
{
fprintf
(
ofile
,
"can't open directory `%s'
\n
"
,
path
);
free
(
path
);
return
1
;
}
while
(
dirent
=
readdir
(
dir
))
{
if
(
dirent
->
d_name
[
0
]
==
'.'
)
continue
;
fprintf
(
ofile
,
"%s
\n
"
,
dirent
->
d_name
);
}
closedir
(
dir
);
free
(
path
);
return
0
;
}
...
...
Please
register
or
sign in
to post a comment