public void dir(File v) { checkRun(); if (v != null && (!v.exists() || !v.isDir())) { throw ArgErr.make("Invalid working directory: " + v).val; } this.m_dir = v; }
public virtual List findAllPodNames() { List acc = new List(Sys.StrType); List files = findFile(Uri.fromStr("lib/fan/")).list(); for (int i = 0; i < files.sz(); ++i) { File f = (File)files.get(i); if (f.isDir() || "pod" != f.ext()) { continue; } acc.add(f.basename()); } return(acc); }
public override File moveTo(File to) { if (isDir() != to.isDir()) { if (isDir()) { throw ArgErr.make("moveTo must be dir `" + to + "`").val; } else { throw ArgErr.make("moveTo must not be dir `" + to + "`").val; } } if (!(to is LocalFile)) { throw IOErr.make("Cannot move LocalFile to " + to.@typeof()).val; } LocalFile dest = (LocalFile)to; if (dest.exists()) { throw IOErr.make("moveTo already exists: " + to).val; } try { if (m_file is FileInfo) { (m_file as FileInfo).MoveTo((dest.m_file as FileInfo).FullName); } else { (m_file as DirectoryInfo).MoveTo((dest.m_file as DirectoryInfo).FullName); } } catch (System.IO.IOException) { throw IOErr.make("moveTo failed: " + to).val; } return(to); }
public override File moveTo(File to) { if (isDir() != to.isDir()) { if (isDir()) throw ArgErr.make("moveTo must be dir `" + to + "`").val; else throw ArgErr.make("moveTo must not be dir `" + to + "`").val; } if (!(to is LocalFile)) throw IOErr.make("Cannot move LocalFile to " + to.@typeof()).val; LocalFile dest = (LocalFile)to; if (dest.exists()) throw IOErr.make("moveTo already exists: " + to).val; try { if (m_file is FileInfo) (m_file as FileInfo).MoveTo((dest.m_file as FileInfo).FullName); else (m_file as DirectoryInfo).MoveTo((dest.m_file as DirectoryInfo).FullName); } catch (System.IO.IOException) { throw IOErr.make("moveTo failed: " + to).val; } return to; }
public void dir(File v) { checkRun(); if (v != null && (!v.exists() || !v.isDir())) throw ArgErr.make("Invalid working directory: " + v).val; this.m_dir = v; }