create directories when opening any file for writing, because it's a real pain having...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 27 Mar 2003 08:01:33 +0000 (08:01 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 27 Mar 2003 08:01:33 +0000 (08:01 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2853 d7cf8633-e32d-0410-b094-e92efae38249

fs.c

diff --git a/fs.c b/fs.c
index eeb41d9..33ccc73 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -573,6 +573,10 @@ qfile_t* FS_Open (const char* filepath, const char* mode, qboolean quiet)
 
                // Open the file on disk directly
                snprintf (real_path, sizeof (real_path), "%s/%s", fs_gamedir, filepath);
+
+               // Create directories up to the file
+               FS_CreatePath (real_path);
+
                return FS_SysOpen (real_path, mode);
        }