internal static NbtAddress GetByName(Name name) { lock (typeof(Lmhosts)) { NbtAddress result = null; try { if (Filename != null) { FilePath f = new FilePath(Filename); long lm; if ((lm = f.LastModified()) > _lastModified) { _lastModified = lm; Tab.Clear(); _alt = 0; Populate(new FileReader(f)); } result = (NbtAddress)Tab[name]; } } catch (FileNotFoundException fnfe) { if (_log.Level > 1) { _log.WriteLine("lmhosts file: " + Filename); Runtime.PrintStackTrace(fnfe, _log); } } catch (IOException ioe) { if (_log.Level > 0) { Runtime.PrintStackTrace(ioe, _log); } } return result; } }
public FileWriter (FilePath path) : base(path.GetPath ()) { }
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); }
public bool RenameTo (FilePath file) { return RenameTo (file._path); }
public FilePath (FilePath other, string child) : this ((string) other, child) { }
public FileWriter(FilePath path) : base(new FileOutputStream(path)) { }
public RandomAccessFile (FilePath file, string mode) : this(file.GetPath (), mode) { }
public FileInputStream (FilePath file) : this(file.GetPath ()) { }
public PrintWriter (FilePath path) { _writer = new StreamWriter (path); }