1 #if !defined(lint) && !defined(DOS)
2 static char rcsid
[] = "$Id: creatdir.c 769 2007-10-24 00:15:40Z hubert@u.washington.edu $";
6 * ========================================================================
7 * Copyright 2006-2007 University of Washington
8 * Copyright 2013-2016 Eduardo Chappa
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * ========================================================================
20 #include "../charconv/utf8.h"
21 #include "../charconv/filesys.h"
26 #define MAILDIR_MODE S_IRWXU
28 #define MAILDIR_MODE 0700
33 /*----------------------------------------------------------------------
34 Create the mail subdirectory.
36 Args: dir -- Name of the directory to create
38 Result: Directory is created. Returns 0 on success, else -1 on error
42 create_mail_dir(char *dir
)
44 if(our_mkdir(dir
, MAILDIR_MODE
) < 0)
48 our_chmod(dir
, MAILDIR_MODE
);
50 /* Some systems need this, on others we don't care if it fails */
51 our_chown(dir
, getuid(), getgid());
52 #endif /* !_WINDOWS */