forked from akivjhirad/DeltaHacks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilecheck.m
More file actions
25 lines (25 loc) · 803 Bytes
/
filecheck.m
File metadata and controls
25 lines (25 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function newfile = checkfile()
dir_content = dir;
filenames = {dir_content.name};
current_files = filenames;
while true
dir_content = dir;
filenames = {dir_content.name};
newfile = setdiff(filenames,current_files);
len = size(filenames);
fileID = fopen('data2.txt', 'w');
if ~isempty(newfile)
for i = 1:len
store = filenames(i);
if (((strcmp(store(len-3:len), 'png'))) || ((strcmp(store(len-3:len), 'jpg'))))
fprintf(fileID, '%d \t %c', compare(store, newfile), char(store));
end
end
% deal with the new files
current_files = filenames;
else
fprintf('no new files\n')
end
fclose(fileID);
pause(1);
end