This repository was archived by the owner on Oct 11, 2022. It is now read-only.
forked from nickelsworth/swag
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0092.pas
More file actions
69 lines (55 loc) · 1.46 KB
/
Copy path0092.pas
File metadata and controls
69 lines (55 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
DELM - Multiple delete
(C) 1996 Scott Tunstall.
Without entering any crap utils like CO, DR etc you can do this
straight from the command line.. nice 'n' easy !! :)
}
Uses Dos;
Procedure Usage;
Begin
Writeln;
Writeln;
Writeln('DELM - Delete Multiple Files quickly via command line.');
Writeln('(C) 1996 Scott Tunstall. All rights reserved.');
Writeln;
Writeln('Usage :');
Writeln;
Writeln('DELM <FileSpec1> [FileSpec2] [FileSpec3..]');
Writeln;
Writeln;
End;
Procedure RemoveFiles(FirstParmToUse, EndParm: byte);
Var
Fails: byte; { No of missed files }
Count: byte;
Rec: SearchRec;
FileToErase: file;
Begin
Fails:=0;
For Count:=FirstParmToUse To EndParm do
Begin
FindFirst(ParamStr(Count), $2F, Rec);
If DosError <>0 Then
Begin
Writeln('No file matches the pattern ', ParamStr(Count), '!');
Inc(Fails);
End
Else
while DosError = 0 do
Begin
Writeln('Deleting ', Rec.Name, '.');
Assign(FileToErase, Rec.Name);
{$i-}
Erase(FileToErase);
{$i+}
FindNext(Rec);
End;
End;
Halt(Fails);
End;
Begin
If ParamCount = 0 Then
Usage
Else
RemoveFiles(1, ParamCount);
End.