Click here to Skip to main content
15,887,898 members
Please Sign up or sign in to vote.
3.67/5 (3 votes)
See more:
I made a small program that goes through my Google Drive and deletes certain files, however I still see them when I vsisit drive.google.com. I know they were deleted since my program can't find the deleted files and Google gives me an error if I click on them. Here's an example:

C#
//My authorized DriveService
if (_service == null)
    return;

//Clean up files older than 1 day
List<File> fileList = Utilities.RetrieveAllFiles(_service);
if (fileList.Count == 0)
    return;

int counter = 0;

foreach (File item in fileList)
{
    if (ForDeletion(item))
    {
        _service.Files.Delete(item.Id).Fetch();
    }
    counter++;
}


Am I doing something wrong or is it a problem with Google Drive not updating properly?

EDIT: Just double checked and the files no longer show up in my Drive, but considering I ran into this issue a few hours ago that's still not acceptable.
Posted
Updated 10-Apr-13 4:14am
v4
Comments
ZurdoDev 10-Apr-13 10:07am    
Have you read through google's development docs for this?
Neven Iliev 10-Apr-13 10:09am    
Yes, haven't been able to find anything of help. The Google API docs are not very good in the first place, especially for .NET.
CHill60 10-Apr-13 10:27am    
Google Drive does not have a particularly good reputation judging by the comments on the forum here https://productforums.google.com/forum/?fromgroups#!forum/drive[^] - which may be a better forum (excuse the pun) for your comments
fjdiewornncalwe 10-Apr-13 13:11pm    
Because you throw an error when you click on the deleted file in the Google Drive window, I'm curious is you have a simple situation where the Google Drive window is simply in need of a refresh to update the status/existence of content?
Mike Meinz 10-Apr-13 13:45pm    
When you check on the files via the Google Drive web interface after you have deleted them, you are probably seeing a cached version. Eventually, the cache expires and the current status is retrieved. This is a consequence of Google Drive's distributed design and the extensive use of cache algorithms to provide good performance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900