I use obj "IDLnetUrl", but the printf cant be effect without the code matter.
( the printf cant print the string into the txt)
the code is follow:
oUrl = OBJ_NEW('IDLnetUrl')
oUrl->SetProperty, CALLBACK_FUNCTION ='Url_Callback'
oUrl->SetProperty, VERBOSE = 1
oUrl->SetProperty, URL_SCHEME = 'ftp'
oUrl->SetProperty, URL_HOST = '128.138.97.102'
oUrl->SetProperty, URL_USERNAME = 'anonymous'
oUrl->SetProperty, URL_PASSWORD = '*****'
oUrl->SetProperty, URL_PATH =newurlPath
nextDirList = oUrl->GetFtpDirList()
OBJ_DESTROY, oUrl
for i=0,N_ELEMENTS(nextDirList)-1 do begin
nextTemp=nextDirList[i]
nextParts=strsplit(nextTemp,/extract,count=numFs)
if numFs lt 9 then continue
fn=nextParts[8]
fnParts=strsplit(fn,'.',/extract,count=numFnP)
if numFnP lt 6 then continue
if fnParts[5] eq 'hdf' and fnParts[2] eq fnKey then begin
str='ftp://n5eil01u.ecs.nsidc.org'+newUrlPath+'/'+fn
printf,lunTar_1,str
end
end
|