public static string MakeShortFileName(this string path) { string dir = Path.GetDirectoryName(path); string longName = Path.GetFileName(path); // if (longName.Length > 31) longName = longName.Substring(0, 31); if (longName.Length <= 31 && IsoUtilities.IsValidFileName(longName)) { return(path); } char[] shortNameChars = longName.ToUpper(CultureInfo.InvariantCulture).ToCharArray(); for (int i = 0; i < shortNameChars.Length; ++i) { if (!IsoUtilities.IsValidDChar(shortNameChars[i]) && shortNameChars[i] != '.' && shortNameChars[i] != ';') { shortNameChars[i] = '_'; } } string filename = new string(shortNameChars); if (filename.Length > 31) { filename = filename.Substring(0, 31); } return(Path.Combine(dir, filename)); }
public ContinuationSystemUseEntry(string name, byte length, byte version, byte[] data, int offset) { CheckAndSetCommonProperties(name, length, version, 28, 1); Block = IsoUtilities.ToUInt32FromBoth(data, offset + 4); BlockOffset = IsoUtilities.ToUInt32FromBoth(data, offset + 12); Length = IsoUtilities.ToUInt32FromBoth(data, offset + 20); }
public PosixFileInfoSystemUseEntry(string name, byte length, byte version, byte[] data, int offset) { CheckAndSetCommonProperties(name, length, version, 36, 1); FileMode = IsoUtilities.ToUInt32FromBoth(data, offset + 4); NumLinks = IsoUtilities.ToUInt32FromBoth(data, offset + 12); UserId = IsoUtilities.ToUInt32FromBoth(data, offset + 20); GroupId = IsoUtilities.ToUInt32FromBoth(data, offset + 28); Inode = 0; if (length >= 44) { Inode = IsoUtilities.ToUInt32FromBoth(data, offset + 36); } }
public PosixFileInfoSystemUseEntry(byte[] data, int offset) { byte len = data[offset + 2]; Name = "PX"; Version = data[offset + 3]; CheckLengthAndVersion(len, 36, 1); FileMode = IsoUtilities.ToUInt32FromBoth(data, offset + 4); NumLinks = IsoUtilities.ToUInt32FromBoth(data, offset + 12); UserId = IsoUtilities.ToUInt32FromBoth(data, offset + 20); GroupId = IsoUtilities.ToUInt32FromBoth(data, offset + 28); Inode = 0; if (len >= 44) { Inode = IsoUtilities.ToUInt32FromBoth(data, offset + 36); } }
public ChildLinkSystemUseEntry(string name, byte length, byte version, byte[] data, int offset) { CheckAndSetCommonProperties(name, length, version, 12, 1); ChildDirLocation = IsoUtilities.ToUInt32FromBoth(data, offset + 4); }