From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,48e481087721b6b9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-18 13:54:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!torn!snoopy.risq.qc.ca!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Need to check access and modify time of a file References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 18 Sep 2003 16:39:50 -0400 NNTP-Posting-Host: 198.96.223.163 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1063917574 198.96.223.163 (Thu, 18 Sep 2003 16:39:34 EDT) NNTP-Posting-Date: Thu, 18 Sep 2003 16:39:34 EDT Organization: Bell Sympatico Xref: archiver1.google.com comp.lang.ada:42668 Date: 2003-09-18T16:39:50-04:00 List-Id: Preben Randhol wrote: > On 2003-09-17, Larry Kilgallen wrote: >>In article , Preben Randhol writes: >>>Hi >>> >>>I need to make a small application that can check the modification and >>>access time of some files. I use GNAT. Does anyboyd have some code doing >>>this they want to share. Or if you could point me in the right >>>directions. Sorry for asking and not figuring it out myself, but I'm >>>very pressed for time. >> >>The very availability of the access time for a file depends on your >>operating system. > > Linux. It is a Linux only application. I thought that GNAT had a > function to do this, but I don't find it at the moment. Preben, try FLORIST: with POSIX.File_Status; with POSIX.Calendar.POSIX_Time; declare use POSIX.FIle_Status; S : Status; D : POSIX.Calendar.POSIX_Time; begin S := Get_File_Status(Pathname); -- Given a pathname -- S := Get_File_Status(File_Descriptor); -- Given an open file descriptor D := Last_File_Modification_Of(S); You'll have to root around in FLORIST to convert this to a string form of a date, but that will get you started. -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg