/// <nodoc/> public FileMaterializationInfo GetFileMaterializationInfo(PathTable pathTable) { return new FileMaterializationInfo( new FileContentInfo(ContentHash.ToContentHash(), FileContentInfo.LengthAndExistence.Deserialize(Length)), !string.IsNullOrEmpty(FileName) ? PathAtom.Create(pathTable.StringTable, FileName) : PathAtom.Invalid, ReparsePointInfo.Create(ReparsePointType.ToReparsePointType(), ReparsePointTarget)); }
/// <summary> /// Creates ReparsePointInfo from a string representation of target path. /// </summary> public static ReparsePointInfo Create(ReparsePointType reparsePointType, string targetPath) { Contract.Requires(!reparsePointType.IsActionable() || !string.IsNullOrEmpty(targetPath)); if (!reparsePointType.IsActionable()) { return(CreateNoneReparsePoint()); } return(new ReparsePointInfo(reparsePointType, targetPath)); }
/// <nodoc /> public static BondReparsePointType ToBondReparsePointType(this ReparsePointType reparsePointType) { switch (reparsePointType) { case ReparsePointType.None: return(BondReparsePointType.None); case ReparsePointType.SymLink: return(BondReparsePointType.SymLink); case ReparsePointType.MountPoint: return(BondReparsePointType.MountPoint); case ReparsePointType.NonActionable: return(BondReparsePointType.NonActionable); default: throw Contract.AssertFailure("Cannot convert ReparsePointType to BondReparsePointType"); } }
/// <inheritdoc /> public bool IsReparsePointActionable(ReparsePointType reparsePointType) { Contract.Requires(reparsePointType != ReparsePointType.MountPoint, "Currently, ReparsePointType.MountPoint is not a valid reparse point type on macOS/Unix"); return(reparsePointType == ReparsePointType.SymLink); }
/// <see cref="IFileSystem.IsReparsePointActionable(ReparsePointType)"/> public static bool IsReparsePointActionable(ReparsePointType reparsePointType) { return(s_fileSystem.IsReparsePointActionable(reparsePointType)); }
private ReparsePointInfo(ReparsePointType reparsePointType, string targetPath) { ReparsePointType = reparsePointType; m_targetString = targetPath; }
private static bool IsMicrosoftReparseTag(ReparsePointType tag) { return ((uint)(tag) & 0x80000000) != 0; }
public LinkReparsePointInfo(ReparsePointType type, string path, string target) : base(path, type) { this.target = ReparsePointHelper.MakeParsedPath(target); }
protected internal ReparsePointInfo(string path, ReparsePointType tag) { this.path = path; this.tag = tag; }
/// <inheritdoc /> public bool IsReparsePointActionable(ReparsePointType reparsePointType) { return(reparsePointType == ReparsePointType.SymLink); }
private static bool IsMicrosoftReparseTag(ReparsePointType tag) { return(((uint)(tag) & 0x80000000) != 0); }
/// <summary> /// Checks whether the reparse point is actionable, i.e., a mount point or a symlink. /// </summary> public static bool IsActionable(this ReparsePointType reparsePointType) { return(FileUtilities.IsReparsePointActionable(reparsePointType)); }