Ejemplo n.º 1
0
        public static FilePath CreateTempFile(string prefix, string suffix, FilePath directory)
        {
            string file;
            if (prefix == null) {
                throw new ArgumentNullException ("prefix");
            }
            if (prefix.Length < 3) {
                throw new ArgumentException ("prefix must have at least 3 characters");
            }
            string str = (directory == null) ? Path.GetTempPath () : directory.GetPath ();
            do {
                file = Path.Combine (str, prefix + Interlocked.Increment (ref tempCounter) + suffix);
            } while (File.Exists (file));

            new FileOutputStream (file).Close ();
            return new FilePath (file);
        }
Ejemplo n.º 2
0
 public RandomAccessFile(FilePath file, string mode)
     : this(file.GetPath (), mode)
 {
 }
Ejemplo n.º 3
0
 public FileOutputStream(FilePath file)
     : this(file.GetPath (), false)
 {
 }
Ejemplo n.º 4
0
 public FileOutputStream(FilePath file, bool append)
     : this(file.GetPath (), append)
 {
 }
Ejemplo n.º 5
0
 public FileReader(FilePath f)
     : base(f.GetPath ())
 {
 }
Ejemplo n.º 6
0
 public FileWriter(FilePath path)
     : base(path.GetPath ())
 {
 }
Ejemplo n.º 7
0
 public FileInputStream(FilePath file)
     : this(file.GetPath ())
 {
 }