3 * @brief File services for Unix
6 * See mprGenFile.c for other file services.
9 /******************************************************************************/
13 * Copyright (c) Mbedthis Software LLC, 2003-2006. All Rights Reserved.
15 * This software is distributed under commercial and open source licenses.
16 * You may use the GPL open source license described below or you may acquire
17 * a commercial license from Mbedthis Software. You agree to be fully bound
18 * by the terms of either license. Consult the LICENSE.TXT distributed with
19 * this software for full details.
21 * This software is open source; you can redistribute it and/or modify it
22 * under the terms of the GNU General Public License as published by the
23 * Free Software Foundation; either version 2 of the License, or (at your
24 * option) any later version. See the GNU General Public License for more
25 * details at: http://www.mbedthis.com/downloads/gplLicense.html
27 * This program is distributed WITHOUT ANY WARRANTY; without even the
28 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
30 * This GPL license does NOT permit incorporating this software into
31 * proprietary programs. If you are unable to comply with the GPL, you must
32 * acquire a commercial license to use this software. Commercial licenses
33 * for this software and support services are available from Mbedthis
34 * Software at http://www.mbedthis.com
39 /********************************** Includes **********************************/
43 /************************************ Code ************************************/
45 int mprGetFileInfo(MprCtx ctx, const char *path, MprFileInfo *info)
52 if (stat(path, &s) < 0) {
56 info->size = s.st_size;
57 info->ctime = s.st_ctime;
58 info->mtime = s.st_mtime;
59 info->inode = s.st_ino;
60 info->isDir = (s.st_mode & S_IFDIR) != 0;
61 info->isReg = (s.st_mode & S_IFREG) != 0;
63 if (strcmp(path, "/dev/null") == 0) {
70 /******************************************************************************/
72 int mprMakeDir(MprCtx ctx, const char *path, int perms)
74 return mkdir(path, perms);
77 /******************************************************************************/
84 * vim600: sw=4 ts=4 fdm=marker