Wednesday, September 18, 2019

windows - Delete a phantom directory created by Google Drive


I recently noticed that there is a file (a document) in my Google Drive that failed to sync. I didn't need it, so I deleted it.


Now, in my computers GD folder there is a directory with the name of that document. And it can not be deleted, renamed, etc.


I can open it, create files (and directories) inside of it, open files inside of it, modify/save those files, and delete them.


But if I delete or rename the directory its self, I get an error:



Could not find this item


This is no longer located in C:[path to file].


Verify the item's location and try again.



The file has been deleted in Drive, and my trash has been cleared. It should be gone, but it still shows up! I even tried removing it with alternate file managers, which also show that it exists, but can not delete it (similar error messages). And I attempted to do it with command prompt, but:



The system cannot find the file specified.



This is very annoying, and Drive still calls those files unsyncable:



Download Error - You only have permissions to view this file, so your


changes can not be synced.



Permissions should(?) be irrelevant, as I created the file, and it was never shared.


For reference: Running Windows 8 x64


Interesting edit:


If I create a folder by that name in GD, it will show up in windows as if I had two directories of the same name. I can hit delete on either, but the one with the newer time-stamp will be deleted (even if I attempted to delete the older one). And the other (older) will remain impossible to delete.


Answer



Open command prompt, navigate to Google Drive folder, Use


dir /x

to view the 8.3 format filenames and use that to delete the folder in question


For example, if the 8.3 format name of the folder in question is NAME~1:


del NAME~1

Got my answer from here. Excerpts from that answer as to why this happens:


A filename conflict: They are rare (they are not supposed to happen), but certain circumstances (like race-conditions) can lead to them occurring. In this case, the best way to deal with them is the same as when dealing with files with invalid filenames (like those with illegal characters in them or spaces in the DOS days).


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...