Reputation: 31
Logger.log(DocsList.getRootFolder().getFolders()[0].getSize()); //returns zero
Logger.log(DocsList.getRootFolder().getFiles()[0].getSize()); //returns zero
Any tips???
Upvotes: 1
Views: 520
Reputation: 46794
AFAIK this is normal behavior ... a Google folder has no size... and the first file you get is probably a Google document (or spreadsheet) which has no size either (meaning it takes no space, only 'foreign files' take space in your drive storage).
This is clearly explained in the DRIVE UI when they tell you that you have a free 5 GB storage and how this is to be considered
Upvotes: 1
Reputation: 7957
Folder.getSize () is not a documented method. So, its hard to say what is expected as output. If you are looking to get the number of folders in the root folder, use
Logger.log(DocsList.getRootFolder().getFolders().length);
Upvotes: 0