home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sibdemo3.zip
/
SAMPLES.DAT
/
SAMPLES
/
FILEINFO
/
FILEU1.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1997-07-08
|
2KB
|
70 lines
unit fileu1;
interface
uses
SysUtils, Classes, Forms, Graphics, FileCtrl, Buttons, StdCtrls, LED;
type
TForm1 = class (TForm)
DriveComboBox1: TDriveComboBox;
Led1: TLed;
Led2: TLed;
Led3: TLed;
Led4: TLed;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
DirectoryListBox1: TDirectoryListBox;
FileListBox1: TFileListBox;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
procedure Edit1OnChange (Sender: TObject);
private
{Insert private declarations here}
public
{Insert public declarations here}
end;
var
Form1: TForm1;
implementation
procedure TForm1.Edit1OnChange (Sender: TObject);
var
S: string;
Info: TSearchRec;
begin
S := Edit1.Text;
if S[Length(S)] = '\' then
begin
{ New drive or directory selected - don't show stats }
Edit2.Caption := '';
Edit3.Caption := '';
LED1.LEDCondition := False;
LED2.LEDCondition := False;
LED3.LEDCondition := False;
LED4.LEDCondition := False;
end
else
begin
{ File selected - show stats }
FindFirst(Edit1.Text, faAnyFile, Info);
Edit2.Text := ToStr(Info.Size) + ' bytes';
Edit3.Text := DateTimeToStr(FileDateToDateTime(Info.Time));
LED1.LEDCondition := (Info.Attr and faArchive <> 0);
LED2.LEDCondition := (Info.Attr and faHidden <> 0);
LED3.LEDCondition := (Info.Attr and faReadOnly <> 0);
LED4.LEDCondition := (Info.Attr and faSysFile <> 0);
FindClose(Info);
end;
end;
initialization
RegisterClasses ([TForm1, TDriveComboBox, TDirectoryListBox, TFileListBox,
TEdit, TLed, TLabel]);
end.