- * Check if folder exists, and create
- * if necessary.
- */
-
-static int
-check_folder (char *folder)
-{
- char *folderdir;
- struct stat st;
-
- /* expand path to the folder */
- folderdir = m_mailpath (folder);
-
- /* Check if folder exists */
- if (stat (folderdir, &st) == NOTOK) {
- int answer;
- char *ep;
-
- if (errno != ENOENT) {
- advise (folderdir, "error on folder");
- return NOTOK;
- }
-
- ep = concat ("Create folder \"", folderdir, "\"? ", NULL);
- answer = getanswer (ep);
- free (ep);
-
- if (!answer)
- return NOTOK;
-
- if (!makedir (folderdir)) {
- advise (NULL, "unable to create folder %s", folderdir);
- return NOTOK;
- }
- }
-
- return OK;
-}
-
-
-/*