Date: Mon, 5 Sep 2005 17:12:35 +0530
Reply-To: "Patnaik, Tirthankar" <tirthankar.patnaik@CITIGROUP.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Patnaik, Tirthankar" <tirthankar.patnaik@CITIGROUP.COM>
Subject: File size on Windows.
Content-Type: text/plain; charset="iso-8859-1"
Folks,
Is there any way one can find the size of a file, and other attributes on Windows? I use an anonymous pipe to take in the list of files in a dir, and all it's subdirectories. I also have code to find out some properties of a file. I'd like to get the size, owner, and other attributes of each file in my dir. Any ideas how?
TIA and best,
-Tir
filename fh pipe 'dir /b /s c:\tir\ddir';
data fdir;
length line $300;
infile fh lrecl=300;
input line $ &;
run;
data info;
length infoname infoval $300;
drop rc fid infonum i close;
rc=filename('abc','C:\Tir\ddir\Learning_Again\SAS\DataStep\074-28.pdf');
fid=fopen('abc');
infonum=foptnum(fid);
do i=1 to infonum;
infoname=foptname(fid,i);
infoval=finfo(fid,infoname);
output;
end;
close=fclose(fid);
run;
data fileatt;
length name $ 20 value $ 40;
drop rc fid j infonum;
rc=filename("myfile","HUIN_cust_class.mdb");
fid=fopen("myfile");
infonum=foptnum(fid);
do j=1 to infonum;
name=foptname(fid,j);
value=finfo(fid,name);
put 'File attribute ' name
'has a value of ' value;
output;
end;
rc=filename("myfile");
run;
Tirthankar Patnaik
International Decision Management
Citibank, N. A.
+44-161-919 4338
+91-98410-69545
|