private FSTabRecord(string line) { var elems = line.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); int addition = 0; if (elems.Length == 5) { addition = 1; } if (elems.Length + addition != 6) { throw new ArgumentException($"Fstab line is in wrong format: {line}"); } Id = new FSTabId(elems[0]); if (elems[1] != "none") { MountPath = new MountPath(elems[1]); } else { MountPath = null; } Filesystem = new Filesystem(elems[2]); Options = addition == 1 ? "" : elems[3]; Dump = int.Parse(elems[4 - addition]); Pass = int.Parse(elems[5 - addition]); }
public FSTabRecord(Volume volume, string options) { Id = new FSTabId(volume.UUID); MountPath = volume.MountPath; Filesystem = volume.FileSystem.Value; Options = options ?? ""; Dump = 0; Pass = 0; }