Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r1549 - trunk: . fsvs/src

fsvs
Discussion topic

Back to topic list

svn commit: r1549 - trunk: . fsvs/src

Author pmarek
Full name P.Marek
Date 2008-03-16 23:07:48 PDT
Message Author: pmarek
Date: 2008-03-16 23:07:48-0700
New Revision: 1549

Modified:
   trunk/ (props changed)
   trunk/fsvs/src/waa.c
   trunk/fsvs/src/waa.h

Log:
waa__mkdir() can now ignore the filename part.


Modified: trunk/fsvs/src/waa.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/waa​.c?view=diff&rev​=1549&p1=trunk/f​svs/src/waa.c&p2​=trunk/fsvs/src/waa.​c&r1=1548&r2​=1549
====================​====================​====================​==================
--- trunk/fsvs/src/waa.c (original)
+++ trunk/fsvs/src/waa.c 2008-03-16 23:07:48-0700
@@ -278,13 +278,16 @@
 }
 
 
-/** Creates a directory \a dir.
+/** -.
  * If it already exists, no error is returned.
  *
  * If needed, the structure is generated recursively.
+ * With \a including_last being \c 0 you can give a filename, and make sure
+ * that the directories up to there are created.
+ *
  *
  * \note The mask used is \c 0777 - so mind your umask! */
-int waa__mkdir(char *dir)
+int waa__mkdir(char *dir, int including_last)
 {
     int status;
     char *last_ps;
@@ -310,12 +313,13 @@
 
                 /* Strip last directory, and *always* undo the change. */
                 *last_ps=0;
- status=waa__mkdir(dir);
+ status=waa__mkdir(dir, 1);
                 *last_ps=PATH_SEPARATOR;
                 STOPIF( status, NULL);
 
                 /* Now the parent was done ... so we should not get ENOENT again. */
- STOPIF( waa__mkdir(dir), NULL);
+ if (including_last)
+ STOPIF( waa__mkdir(dir, 1), NULL);
                 break;
             default:
                 STOPIF(status, "cannot mkdir(%s)", dir);
@@ -431,7 +435,7 @@
 
     Mbin2hex(p2dig, cp, len);
     if (flags & GWD_MKDIR)
- STOPIF( waa__mkdir(*erg), NULL);
+ STOPIF( waa__mkdir(*erg, 1), NULL);
 
     *(cp++) = PATH_SEPARATOR;
     *cp = '\0';
@@ -611,7 +615,7 @@
         BUG_ON(!cp);
 
         *cp=0;
- STOPIF( waa__mkdir(target-​>dest_name), NULL);
+ STOPIF( waa__mkdir(target-​>dest_name, 1), NULL);
         *cp=PATH_SEPARATOR;
 
         /* And give it the correct name. */

Modified: trunk/fsvs/src/waa.h
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/waa​.h?view=diff&rev​=1549&p1=trunk/f​svs/src/waa.h&p2​=trunk/fsvs/src/waa.​h&r1=1548&r2​=1549
====================​====================​====================​==================
--- trunk/fsvs/src/waa.h (original)
+++ trunk/fsvs/src/waa.h 2008-03-16 23:07:48-0700
@@ -186,7 +186,7 @@
 /** Initialize WAA operations. */
 int waa__init(void);
 /** Create a directory; ignore \c EEXIST. */
-int waa__mkdir(char *dir);
+int waa__mkdir(char *dir, int including_last);
 /* Given an \a path and an \a extension, this function returns a
  * \a filehandle that was opened for this entry in the WAA with \a flags. */
 int waa__open(char *path,

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r1549 - trunk: . fsvs/src pmarek P.Marek 2008-03-16 23:07:48 PDT
Messages per page: