Number of files in Box folder does not match Actual files .
AnsweredMy folder Fy2016 shows 74,813 files.
My folder Fy2016/employ shows 338 files.
The script lists out 75,423 files from box folder Fy2016.
The script lists out 364 files from box folder Fy2016/Employ
Why are the numbers so different?
I'm the one that uploaded 75,423 to box.
I'm new to python. Below I wrote a script to read file names from box folder.
from boxsdk import OAuth2, Client
import json, csv
import time
auth = OAuth2(
client_id='s_MYCLIENTID',
client_secret='MY_CLIENT_SECRET',
access_token='MY_ACCESS_TOKEN',
)
# Timer starts
starttime = time.time()
client = Client(auth)
user = client.user().get()
print('********_starting')
print('The current user ID is {0}'.format(user.id))
root_folder = client.folder('MY_FOLDER_ID')
root_folder_with_info = root_folder.get()
print('_a_root_folder_with_info_=_ {0}'.format(root_folder_with_info))
items = list(root_folder.get_items(limit=90000))
item2s = root_folder.get_items()
fname = "output_18err.csv"
arrx = []
try:
for item in item2s:
arrx.append([item.name])
except Exception as e:
print( getattr(e, 'message', repr(e)))
with open(fname, 'w') as f:
csv.writer(f, lineterminator='\n').writerows(arrx)
fname = "output_18.csv"
with open(fname, 'w') as f:
csv.writer(f, lineterminator='\n').writerows(arrx)
time_lapsed = time.time() - starttime
mins = time_lapsed // 60
sec = time_lapsed % 60
hours = mins // 60
mins = mins % 60
print("Time Lapsed = {0}:{1}:{2}".format(int(hours),int(mins),sec))
print('_a_finished')
-
Official comment
Sometimes the Web App can take a little while to update, especially during large file operations. The number should be right soon, if it is not already.
Thanks,
Alex, Box Developer Advocate
Comment actions -
hmmm. You might reach out to support for this. I don't have access to the same support tools they do.
Alex
Please sign in to leave a comment.
Comments
6 comments