Comments (4)
Hi,
the method you are looking for is Microsoft.Windows.ProjFS.Utils.TryGetOnDiskFileState().
D.
from projfs-managed-api.
Ah, there it is!
Thanks
from projfs-managed-api.
@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.
from projfs-managed-api.
Related Issues (20)
- How to tell if a tombstone exists for a file path? HOT 7
- Is there a way to clean up ProjFS placeholders/markup without deleting everything? HOT 2
- Pure virtual file system (without any kind of caching/hydrating) HOT 4
- Is there a way to retrieve the ProviderId and ContentId from a placeholder? HOT 3
- HResult.Handle result code from WriteFileData() and left a hydrated placeholder in a bad state? HOT 2
- After closing SimpleProviderManager artifacts are left behind in the virtual root HOT 1
- PreConvertToFull handler not notified HOT 1
- Revert full state file keeping it hydrated HOT 2
- Document C++ runtime as prerequisite HOT 3
- Proper way to handle renaming placeholder files HOT 3
- Odd file behavior in virtual branches, perhaps after installing Windows Updates HOT 13
- The build agent needs an upgrade to build against the new ProjFS API
- DirectoryEnumerationResults.Add symlink override is incompatible with EnumerateFileSystemInfos on .NET Framework HOT 1
- Why are NuGet packages for this library no longer updated? HOT 1
- This repo is missing important files
- Compiling with Visual Studio 2022 : Change ProjectedFSLib.Managed.Props HOT 1
- Section on BadImageFormatExceptions also applies to FileNotFoundExceptions
- windows 10 projected file system issues
- Upgrade to .NET 8 from .NET Core 3.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from projfs-managed-api.