Example #1
0
 // Gets a temporary path if necessary.
 protected static string GetPath(string path, ES3FileMode fileMode)
 {
     // Attempt to create the directory incase it does not exist.
     ES3IO.CreateDirectory(ES3IO.GetDirectoryName(path));
     if (fileMode != ES3FileMode.Write || fileMode == ES3FileMode.Append)
     {
         return(path);
     }
     return((fileMode == ES3FileMode.Write) ? path + ES3.temporaryFileSuffix : path);
 }
Example #2
0
        // Gets a temporary path if necessary.
        protected static string GetPath(string path, ES3FileMode fileMode)
        {
            // Attempt to create the directory incase it does not exist.
            string directoryPath = ES3IO.GetDirectoryPath(path);

            if (directoryPath != UnityEngine.Application.persistentDataPath)
            {
                ES3IO.CreateDirectory(directoryPath);
            }
            if (fileMode != ES3FileMode.Write || fileMode == ES3FileMode.Append)
            {
                return(path);
            }
            return((fileMode == ES3FileMode.Write) ? path + ES3.temporaryFileSuffix : path);
        }
Example #3
0
        // Gets a temporary path if necessary.
        protected static string GetPath(string path, ES3FileMode fileMode)
        {
            string directoryPath = ES3IO.GetDirectoryPath(path);

            // Attempt to create the directory incase it does not exist if we are storing data.
            if (fileMode != ES3FileMode.Read && directoryPath != ES3IO.persistentDataPath)
            {
                ES3IO.CreateDirectory(directoryPath);
            }
            if (fileMode != ES3FileMode.Write || fileMode == ES3FileMode.Append)
            {
                return(path);
            }
            return((fileMode == ES3FileMode.Write) ? path + ES3IO.temporaryFileSuffix : path);
        }