void *mh_xrealloc(void *, size_t);
char *pwd(void);
char *add(char *, char *);
-int folder_exists(char *);
void create_folder(char *, int, void (*)(int));
int num_digits(int);
entry in the user's profile, or the folder named
.RI \*(lq inbox \*(rq.
If the specified (or default) folder doesn't
-exist, the user will be queried prior to its creation.
+exist, the user will (in
+.B \-nosilent
+mode) be queried prior to its creation.
.PP
When the new messages are incorporated into the folder, they are assigned
numbers starting with the next highest number for the folder. As the
return cp;
}
-/*
-** folder_exists
-** Check to see if a folder exists.
-*/
-int
-folder_exists(char *folder)
-{
- struct stat st;
- int exists = 0;
-
- if (stat(folder, &st) == -1) {
- /*
- ** The folder either doesn't exist, or we hit an error.
- ** Either way return a failure.
- */
- exists = 0;
- } else {
- /* We can see a folder with the right name */
- exists = 1;
- }
-
- return exists;
-}
-
/*
** create_folder
if ((maildir_copy = strdup(maildir)) == NULL)
adios(maildir, "error allocating memory to copy maildir");
- if (!folder_exists(maildir)) {
- /*
- ** If the folder doesn't exist, and we're given the -silent
- ** flag, just fail.
- */
- if (noisy)
- create_folder(maildir, 0, done);
- else
- done(1);
- }
+ create_folder(maildir, noisy ? 0 : 1, done);
if (chdir(maildir) == NOTOK)
adios(maildir, "unable to change directory to");