Giter Club home page Giter Club logo

Comments (4)

Debee416 avatar Debee416 commented on May 14, 2024

Hi,
the method you are looking for is Microsoft.Windows.ProjFS.Utils.TryGetOnDiskFileState().

D.

from projfs-managed-api.

FeralSquid avatar FeralSquid commented on May 14, 2024

Ah, there it is!

Thanks

from projfs-managed-api.

cgallred avatar cgallred commented on May 14, 2024

@FeralSquid note that TryGetOnDiskFileState() will never return a state indicating "virtual"; if you look in Microsoft.Windows.ProjFS.OnDiskFileState you'll see that there is no "virtual" state. That's because a virtual file has no on-disk state. Calling TryGetOnDiskFileState() on a path for a virtual item will cause a request to the provider to hydrate a placeholder (which is why there's a warning that a running provider needs to be cautious calling it; the idea is that it is mainly intended for utility apps).

If you just want to tell the difference between virtual and local (in any state), you can enumerate the item's parent directory. If the FILE_ATTRIBUTE_RECALL_ON_OPEN bit is set for that item in the enumeration then it is virtual. Again, you may need to be careful if the provider is performing the enumeration since it will receive callbacks to supply the contents of the enumeration it is itself requesting.

Note that a provider that supports view changes would be expected to keep track of which items it has hydrated, otherwise it would be difficult and/or expensive for the provider to determine which local items needed to be updated or deleted in the view change.

from projfs-managed-api.

FeralSquid avatar FeralSquid commented on May 14, 2024

from projfs-managed-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.