From: "Ian Huang" Subject: Re: TSearchRec.finddata Date: 17 Nov 1999 00:00:00 GMT Message-ID: <80tes9$5oh15@forums.borland.com> References: <01bf30a1$9f6186e0$fb8ee9d1@Hera> <80t850$5m82@forums.borland.com> <01bf30b0$62bb90a0$fb8ee9d1@Hera> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.delphi.winapi Gerald, Really I don't how to get user who created the file, I think it's not possible on Windows, you can get current owner of the file on NT... here's routine to get file creation time, access time and modification time... Gook luck Ian Huang ---------------------------------------------------------------- procedure TForm1.Button1Click(Sender: TObject); var Security: TSecurityAttributes; FileName: PChar; WriteTime, LocalTime: TFileTime; AccessTime, CreateTime: TFileTime; DosDate, DosTime: Word; SysTime: TSystemTime; hFile: Thandle; begin Security.nLength := SizeOf(TSecurityAttributes); Security.lpSecurityDescriptor := nil; Security.bInheritHandle := false; hFile := CreateFile(PChar(FILENAME), GENERIC_READ or GENERIC_WRITE, FILE_SHARE_READ OR FILE_SHARE_WRITE, @Security, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if hFile = INVALID_HANDLE_VALUE then exit; GetFileTime(hFile, @CreateTime, @AccessTime, @WriteTime); FileTimeToLocalFileTime(CreateTime, LocalTime); FileTimeToSystemTime(LocalTime, SysTime); FileTimeToDosDateTime(LocalTime, DosDate, DosTime); ............... SysTime.wYear SysTime.wHour SysTime.wMinute ................... FileTimeToLocalFileTime(AccessTime, LocalTime); .................... end; --------------------------------------------------------------------- Gerald Morris wrote in message news:01bf30b0$62bb90a0$fb8ee9d1@Hera... > thanks Ian, > > SearchRec.time gets the last modified date. > > but, ... How do I get the original create date? > > and if possible (this is a network thing - so is unlikely) how do I > get who created it? > > Gerald > > Ian Huang wrote in article > <80t850$5m82@forums.borland.com>... > > Hi, > > Here's some functions... > > > > Ian Huang