I've been working on a project recently and have encountered a challenge related to get the values displayed in the "Availability" column. I'm wondering if there's a more direct way to achieve this via scripting.
As a workaroaund, I'm checking for the attributes flags that the item has, using the table below as a guideline:
Availability
Condition
Available when online
O attr (regardless other values)
Available on this device
No O attr (regardless other values)
Always available on this device
P attr (regardless other values)
Always available
?
I'm curious if there's a more straightforward way to script the retrieval of values from the "Availability" column. If any of you have experience or insights into this, I would greatly appreciate your guidance.
Additionally, if you notice any errors in the above table or have alternative suggestions on how to extract the availability values, please feel free to correct or advise.
The easiest thing is probably to use the file attributes rather than the availability column. The attributes given to you via scripting will have FILE_ATTRIBUTE_OFFLINE (0x1000) set when a file is "available when online", and FILE_ATTRIBUTE_PINNED (0x80000) set when it's "always available". If neither are set it's just a normal file.
Cloud systems are a bit of a mess and some use the attributes in completely different ways, which we try to handle internally before presenting those two attributes as meaningful.