0

Does anyone know if it is possible to have python determine if a file on one drive is online-only or if it has been downloaded?

I am asking because I have an issue where a script will break because the folder that it is iterating through has files which are not downloaded, then it takes too long to download the files and the script breaks because of this. Any help would be appreciated.

  • Googling around, it seems like there's a Windows API to determine if a file is present locally: https://stackoverflow.com/questions/49301958/how-to-detect-onedrive-online-only-files Seems like you can call this API from Python using the win32api module: https://stackoverflow.com/questions/27196143/get-file-attributes-hidden-readonly-system-archive-in-python You won't be able to access the `win32con.FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS` attribute, but you can hard code the equivalent value, `0x00400000`. – Nick ODell Mar 16 '23 at 21:27

0 Answers0