{Truncates given file to given length}

{useage: TRNCFILE <filename> <newsize>}

program TrncFile;


uses minilib;


var
	TruncFIle : file of byte;


begin
	writeln('Truncate File Utility  (c) Small Business Solutions, Mar 96/MCH');

	{check user entry}
	if (ParamStr(1)='') or (S2Num(Paramstr(2))=0) then
		writeln('Useage: TRNCFILE <filename> <newsize>')
	else begin
		Assign(TruncFile, ParamStr(1));
		Reset(TruncFile);
		Seek(TruncFile, S2Num(ParamStr(2)));
		Truncate(TruncFile);
		close(TruncFile);
		writeln('File '+ParamStr(1)+' truncated to ',S2Num(ParamStr(2)),' bytes.');
	end;
end.
