home *** CD-ROM | disk | FTP | other *** search
- {$N-} {kein numerischer Coprozessor}
- {$M 10000,1384,5360}
-
- program subdir;
-
- uses
- tastatur,testfile,dos;
-
- var
- s,s1 : string[80];
- error : boolean;
- errornr : word;
- l : byte absolute s1;
- n,i : byte;
-
- begin
- if paramcount>0 then for i:=1 to paramcount do begin
- s:=paramstr(i);
- if s[1]='%' then begin
- delete(s,1,1);
- s:=getenv(s);
- end;
- {$i-}
- chdir(s);
- {$i+}
- n:=0;
- error:=true;
- s1:='';
- while (ioresult<>0) and (n<32) and (error or not (s=s1)) do begin
- s1:=s;
- repeat
- if keypressed and (readkey=^[) then halt(1);
- {$i-}
- mkdir(s1);
- {$i+}
- errornr:=ioresult;
- error:=errornr<>0;
- if error then
- case errornr of
- 5,150 : halt;
- 3 : ;
- else writeln('Error: ',errornr);
- end;
- if error then begin
- while (l>0) and (s1[l]<>'\') and (s1[l]<>':') do delete(s1,l,1);
- if s1[l]='\' then delete(s1,l,1);
- if s1='' then n:=255;
- end;
- inc(n);
- until error=false or (n>=32);
- {$i-}
- chdir(s);
- {$i+}
- end;
- end;
- end.
-