public static PulsarDirectory GetDirectoryByFullName(String fn) { PulsarDirectory d = FileSystem.mFS.Root; if (fn == d.Name) { return(d); } if (fn == null || fn == "") { return(null); } String[] names = fn.Split('/'); if (names[0] != "") { return(null); } for (int i = 0; i < names.Length; i++) { if (names[i] != null && names[i] != "") { d = d.GetDirectoryByName(names[i]); if (d == null) { break; } } } return(d); }
public static File GetFileByFullName(String fn) { PulsarDirectory d = new PulsarDirectory(FileSystem.mFS.Partition, 1, FileSystem.separator); if (fn == null || fn == "") { return(null); } String[] names = fn.Split('/'); for (int i = 0; i < names.Length - 1; i++) { if (names[i] != "") { d = d.GetDirectoryByName(names[i]); if (d == null) { break; } } } return(d.GetFileByName(names[names.Length - 1])); }