home *** CD-ROM | disk | FTP | other *** search
- PROGRAM Vol;
-
- TYPE
- Reg = Record case Integer of
- 1: (AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : Integer);
- 2: (AL,AH,BL,BH,CL,CH,DL,DH : Byte);
- End;
- XFCB = Record { Extended File Control Block }
- Flag : Byte; { Set to $FF to Identify as Extended FCB }
- FRes : Array[1..5] of Byte; { 5 Reserved Bytes }
- Att : Byte; { Attribute of File }
- Drive : Byte; { 0 = Default, 1 = A, 2 = B }
- FName : Array[1..8] of Char; { File Name }
- Ext : Array[1..3] of Char; { Extension }
- CBlock : Integer; { Current Block Number }
- RSize : Integer; { Logical Record Size }
- FSize : Integer; { File Size }
- Date : Integer; { Date Created/Updated }
- SRes : Array[1..10] of Byte; { 10 Reserved Bytes }
- RNum : Byte; { Cur. Rel. Record Number in Block }
- RRNum : Array[1..4] of Byte; { Rel. Rec. Rel. to Begining of File }
- End;
-
- DTARec = Record
- XStuff : Array[1..7] of Byte; { 1st 7 bytes of Ext. FCB }
- DDrive : Byte; { Drive Number }
- FileName : Array[1..8] of Char; { File Name }
- Extension : Array[1..3] of Char; { Extension }
- Attribute : Byte; { Attribute }
- Reserved : Array[1..10] of Byte; { 10 Reserved Bytes }
- FileTime : Integer; { Time Created/Updated }
- FileDate : Integer; { Date Created/Updated }
- Cluster : Integer; { Starting Cluster Number }
- FileSize : Array[1..4] of Byte; { File Size in Bytes }
- End;
-
- MFCB = Array[0..43] of char; { Modified XFCB Used to Rename Files }
-
-
- VAR
- FCB : XFCB;
- DTA : DTARec;
- ModFCB : MFCB;
- Regs : Reg;
- VolumeName : String[11];
- Day,Month,Year,
- Hour,Minute : Integer;
- Size : Real;
-
- PROCEDURE FindVolume;
- VAR I : Integer;
-
- PROCEDURE ShowEntry;
- begin
- DTA.Attribute := DTA.Attribute and 31;
- Write(DTA.FileName,DTA.Extension,' : ',DTA.Attribute);
- Year := (DTA.FileDate shr 9) + 80;
- Month := (DTA.FileDate shl 7) shr 12;
- Day := (DTA.FileDate shl 11) shr 11;
- Write(' ',Month,'-',Day,'-',Year);
- Hour := DTA.FileTime shr 11;
- Minute := (DTA.FileTime shl 5) shr 10;
- Write(' ',Hour,Minute);
- Size := (DTA.FileSize[1] * 1.0) +
- (DTA.FileSize[2] * 256.0) +
- (DTA.FileSize[3] * 65536.0);
- Write(' S=',Size:6:0);
- Begin
- If (DTA.Attribute and $08) = 8 then Write(' <-- Volume Name!');
- If (DTA.Attribute and $01) = 1 then Write(' ReadOnly ');
- If (DTA.Attribute and $02) = 2 then Write(' Hidden ');
- If (DTA.Attribute and $04) = 4 then Write(' System ');
- End;
- WriteLn;
- end; { procedure ShowEntry }
-
- Begin
- With FCB do begin
- Regs.AX := $1A00; { Func.Call $1A (Set DTA) }
- Regs.DS := Seg(DTA);
- Regs.DX := Ofs(DTA);
- MsDos(Regs);
- FillChar(FCB,SizeOf(FCB),0);
- Flag := $FF;
- Att := 15;
- For I := 1 to 8 do FName[I] := '?';
- For I := 1 to 3 do Ext[I] := '?';
- Regs.DS := Seg(FCB);
- Regs.DX := Ofs(FCB);
- Regs.AX := $1100; { Func.Call $11 (Search for First Entry) }
- MsDos(Regs);
- Write(Regs.AL,' : ');
- If Regs.AL <> $FF then ShowEntry;
- If Regs.AL <> $FF then begin
- Repeat
- Regs.DS := Seg(FCB);
- Regs.DX := Ofs(FCB);
- Regs.AX := $1200; { Func.Call $12 (Search for Next Entry) }
- MsDos(Regs);
- Write(Regs.AL,' : ');
- If Regs.AL <> $FF then ShowEntry;
- Until Regs.AL = $FF;
- FillChar(ModFCB,SizeOf(ModFCB),#32);
- ModFCB[0] := #255;
- ModFCB[6] := #8;
- ModFCB[7] := #0;
- VolumeName := 'DOWNLOAD 7 ';
- For I := 1 to 8 do ModFCB[I+7] := VolumeName[I];
- For I := 9 to Length(VolumeName) do ModFCB[I+7] := VolumeName[I];
- VolumeName := 'DUMBCHANGE ';
- For I := 17 to (17 + Length(VolumeName)) do ModFCB[I+7] := VolumeName[I-16];
- WriteLn(ModFCB);
- Regs.DS := Seg(ModFCB);
- Regs.DX := Ofs(ModFCB);
- Regs.AX := $1700;
- MsDos(Regs);
- Write(Regs.AL,' : ');
- End Else Begin
- FillChar(FCB,SizeOf(FCB),0);
- Flag := $FF;
- Att := $08;
- Drive := $00;
- VolumeName := 'DUMBCHANGE ';
- For I := 1 to 8 do FName[I] := VolumeName[I];
- For I := 9 to Length(VolumeName) do Ext[I-8] := VolumeName[I];
- Regs.DS := Seg(FCB);
- Regs.DX := Ofs(FCB);
- Regs.AX := $1600; { Func.Call $16 (Create File) }
- MsDos(Regs);
- WriteLn(Regs.AL,' Opening File');
- Regs.DS := Seg(FCB);
- Regs.DX := Ofs(FCB);
- Regs.AX := $1000; { Func.Call $0F (Close File) }
- MsDos(Regs);
- WriteLn(Regs.AL,' Closing File');
- End;
- WriteLn;
- End; { with FCB }
- End; { procedure FindVolume }
-
- Begin
- FindVolume;
- End.