예제 #1
0
        public static string getTMP()
        {
            if (_tmp == null)
            {
                string tmp = getTMP_EnvName("TMP");

                if (tmp == null)
                {
                    tmp = getTMP_EnvName("TEMP");

                    if (tmp == null)
                    {
                        tmp = getTMP_EnvName("ProgramData");

                        if (tmp == null)
                        {
                            throw null;
                        }

                        // 書き込みテスト -- ProgramDataってゲストでも書けるっぽい。
                        {
                            string dir = Path.Combine(tmp, StringTools.getUUID() + "_test");

                            Directory.CreateDirectory(dir);
                            Directory.Delete(dir);
                        }
                    }
                }
                tmp = Path.Combine(tmp, Program.APP_IDENT);
                deletePath(tmp);
                Directory.CreateDirectory(tmp);
                _tmp = tmp;
            }
            return(_tmp);
        }
예제 #2
0
        public static string getTMP()
        {
            if (_tmp == null)
            {
                string tmp = getTMP_envName("TMP");

                if (tmp == null)
                {
                    tmp = getTMP_envName("TEMP");

                    if (tmp == null)
                    {
                        tmp = getTMP_envName("ProgramData");

                        if (tmp == null)
                        {
                            throw null;
                        }

                        // 書き込みテスト -- ProgramDataってゲストでも書けるっぽい。
                        {
                            string dir = Path.Combine(tmp, StringTools.getUUID() + "_test");

                            Directory.CreateDirectory(dir);
                            Directory.Delete(dir);
                        }
                    }
                }
                tmp = Path.Combine(tmp, Program.APP_IDENT) + ".tmp";

                for (int c = 0; ; c++)
                {
                    string trialTmp = Path.Combine(tmp, StringTools.zPad(c, 4));

                    if (Directory.Exists(trialTmp) == false)
                    {
                        tmp = trialTmp;
                        break;
                    }
                }
                Directory.CreateDirectory(tmp);
                _tmp = tmp;
            }
            return(_tmp);
        }
예제 #3
0
 public NamedEventPair()
     : this(StringTools.getUUID())
 {
 }
예제 #4
0
 public string makePath()
 {
     return(makePath(StringTools.getUUID()));
 }
예제 #5
0
 public WorkingDir()
     : this(StringTools.getUUID())
 {
 }