Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Get attributes and created  of Folder

Posted on 2004-10-12
2
Medium Priority
?
172 Views
Last Modified: 2010-04-05
Hello Experts.

 i know how get size of folder but don't know how get get attributes and created day of Folder, please teach me.
 Thanks.
0
Comment
Question by:z27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 17

Accepted Solution

by:
geobul earned 200 total points
ID: 12295723
Hi,

For creation datetime of a folder:

function GetFileCreated(const filename: string): TDateTime;
var sr:TSearchRec;
  SysTimeStruct: SYSTEMTIME;
  lft:_FILETIME;
begin
  Result:=0; // if the file won't be found
  if FindFirst(FileName,faAnyFile,sr) = 0 then
  begin
    if FileTimeToLocalFileTime(sr.FindData.ftCreationTime, lft) and
      FileTimeToSystemTime(lft, SysTimeStruct) then begin
      result := SystemTimeToDateTime(SysTimeStruct);
    end;
  end;
  FindClose(sr);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  ShowMessage(FormatDateTime('dd.mm.yyyy hh:nn:ss', GetFileCreated('c:\temp')));
end;

Regards, Geo
0
 
LVL 17

Expert Comment

by:geobul
ID: 12295876
For attributes:

procedure TForm1.Button1Click(Sender: TObject);
begin
  if (GetFileAttributes(PChar(Edit1.Text)) and faReadOnly) > 0 then ShowMessage('ReadOnly');;
end;

Look TSearchRec description in Delphi help for other attribute constants like faHidden, etc..

Regards, Geo
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question