Check for folder's existence off FTP Server

Hello,
I'd like to extract the most recent files from this server: <ftp://n4ftl01u.ecs.nasa.gov/SAN/AMSA/AE_Land3.002/>
How do I check for a file's existence? Due to the large amt of files, dir(f) only returns so many values. I have also tried fopen, isdir, and exist. I don't believe these functions work with ftp. My code is below:
for i = 2:6
time = now - i; %check several days before today.
datevector = datevec(time);
%open ftp server and extract file
f= ftp('n4ftl01u.ecs.nasa.gov:21');
cd(f,['/SAN/AMSA/AE_Land3.002/']);
x = fopen(['ftp://n4ftl01u.ecs.nasa.gov/SAN/AMSA/AE_Land3.002/' num2str(datevector(1), '%03d') '.' num2str(datevector(2), '%02d') '.' num2str(datevector(3), '%02d') '/']);
if (x ~= -1)
break
end
end

 채택된 답변

Esther
Esther 2011년 8월 4일

0 개 추천

~isempty(dir(filename))

추가 답변 (1개)

Donna
Donna 2011년 8월 5일

0 개 추천

It was just:
x = ~isempty(dir(f,[ num2str(datevector(1), '%03d') '.' num2str(datevector(2), '%02d') '.' num2str(datevector(3), '%02d')]));

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2011년 8월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by