acorp
asked on
command line program
i need it urgent
it's for my exam
i need command line program that reads the directory (dir name given in the command line) and shows the size of the current dir
then after second user input it sorts the dir with size bigger than the size given
it's for my exam
i need command line program that reads the directory (dir name given in the command line) and shows the size of the current dir
then after second user input it sorts the dir with size bigger than the size given
? a bat can do it ? be more specific !
@echo off
if %1 =="" goto Usage
dir %1
pause
dir %1 /os
goto exit
:usage
echo Give a dir
:exit
meikl
@echo off
if %1 =="" goto Usage
dir %1
pause
dir %1 /os
goto exit
:usage
echo Give a dir
:exit
meikl
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oops, forgotten, the whole whole size
replace with this
var
TheDir : String;
CollectedSize : Integer;
procedure GetFiles(PathFileName : string; Size : Integer);
var
srec : TSearchRec;
Path, FileName : String;
begin
Form1.Memo1.Lines.Clear;
CollectedSize := 0;
Path := ExtractFilePath(PathFileNa me);
FileName := ExtractFileName(PathFileNa me);
if findfirst(PathFileName,faa nyfile,sre c) = 0 then
repeat
If Not(srec.attr and fadirectory > 0) then
if srec.size > size then
begin
Form1.Memo1.Lines.add(Srec .Name + '//'+ inttostr(Srec.size));
CollectedSize := CollectedSize + Srec.Size;
end;
Until findnext(srec) <> 0;
FindClose(SRec);
Form1.Edit1.text := InttoStr(CollectedSize);
end;
meikl
replace with this
var
TheDir : String;
CollectedSize : Integer;
procedure GetFiles(PathFileName : string; Size : Integer);
var
srec : TSearchRec;
Path, FileName : String;
begin
Form1.Memo1.Lines.Clear;
CollectedSize := 0;
Path := ExtractFilePath(PathFileNa
FileName := ExtractFileName(PathFileNa
if findfirst(PathFileName,faa
repeat
If Not(srec.attr and fadirectory > 0) then
if srec.size > size then
begin
Form1.Memo1.Lines.add(Srec
CollectedSize := CollectedSize + Srec.Size;
end;
Until findnext(srec) <> 0;
FindClose(SRec);
Form1.Edit1.text := InttoStr(CollectedSize);
end;
meikl
Hi Meikl,
I think you're missing a very important part of the question:
"Its for my exam"
The EE guidelines clearly state that EE forums may not be used for solutions to homework and related problems. Both the asker and the answerer of such questions risk being thrown off EE.
Cheers,
Raymond.
I think you're missing a very important part of the question:
"Its for my exam"
The EE guidelines clearly state that EE forums may not be used for solutions to homework and related problems. Both the asker and the answerer of such questions risk being thrown off EE.
Cheers,
Raymond.
oops, overlooked this, thanks raymond.
acorp, let delete this q.
acorp, let delete this q.
a commandline-program like a dosbox?
meikl