Filter löschen
Filter löschen

Iteratively downloading Dropbox Desktop files stored in cloud one at a time to process and then deleting

1 Ansicht (letzte 30 Tage)
I have a large (150 GB) Dropbox Desktop directory "/Users/myuser/Dropbox/New Data" which is stored in "online" mode, so these files are not currently downloaded on my SSD (I can double click them to download and open). Within this directory are many subfolders of subfolders of files - the files I want are the file pairs of "EventList.xlsx" and the edf file present in each of the smallest folders. I want to run a function "myfunction" on each of these file pairs and store the outputs in a matrix.
I tried:
DBdir = "/Users/myuser/Dropbox/New Data";
EL = "EventList.xlsx";
TDir1 = tempname() + ".cache";
TDir2 = tempname() + ".cache";
mkdir(TDir1);
mkdir(TDir2);
X = [];
edfinfo = dir(DBdir + '/**/*.edf');
edfnames = fullfile({edfinfo.folder}, {edfinfo.name});
numedf = numel(edfnames);
for K = 1 : numedf
thisedf = edfnames{K};
[thisfolder, thisbase, thisext] = fileparts(thisedf);
thisEL = fullfile(thisfolder, EL);
copyfile(thisedf, TDir1, 'f');
copyfile(thisEL, TDir2, 'f');
Tedfname = fullfile(TDir1, [thisbase thisext]);
TELname = fullfile(TDir2, EL);
try
A = myfunction(TELname, Tedfname);
X = [X; A];
end
try delete(Tedfname); end
try delete(TELname); end
end
save('X.mat','X')
The problem I am encountering is that when I reach copyfile, then I am copying a blank edf file to the temporary directory TDir1 and a blank Excel file to the temporary directory TDir2. If I go to the first smallest subfolder in my Dropbox Desktop and double click the edf and Excel files I want to download them to my SSD and then run this code, it will successfully run the complete the first loop, but then result in an error in the second iteration of the for loop since the next file pair isn't downloaded.
Does anyone know how I can fix?

Antworten (1)

Animesh
Animesh am 31 Mai 2023
Hi Shri,
I understand that you want to download files from your Dropbox folder with the help of MATLAB.
To download files from Dropbox you can use this file from MATLAB file exchange :
This file consistes of a function named downloadFromDropbox which can be used to download files from Dropbox.

Kategorien

Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by