comp.lang.ada
 help / color / mirror / Atom feed
From: "Bennett, Chip (KTR) ~U" <BennettC@J64.STRATCOM.AF.MIL>
Subject: Re: Filename comparison ... HELP NEEDED!
Date: Mon, 5 Dec 1994 10:27:00 PST
Date: 1994-12-05T10:27:00-08:00	[thread overview]
Message-ID: <2EE35B0F@SMTPGATE2.STRATCOM.AF.MIL> (raw)

In comp.lang.ada you wrote

> Does anybody know of an good solution to seeing if two filenames given
actually
> point at the same file in the file system?  (Probably a solution in C).

You could use stat or lstat to get info about a file that is the same (file
system and inode number) even if the aliases for the file are different.
 Your choice of stat or lstat depends on whether you want symbolic links to
act like "different" files or not.

Also, this can be easily done in Ada using the system interface package
provided with the compiler.  If your compiler doesn't have a UNIX system
interface package (most do), the bindings to stat and lstat and the
conversion of the "C" data structure to Ada is also straight forward.

I agree with another response to this post, that it was inappropriate for
you to splatter the news groups with this question.  However, I think I
saved your good name in THIS group by pointing out the "Ada" aspects.  :-)

*****************************************************************
* Chip Bennett, GDE Systems Inc | BennettC@j64.stratcom.af.mil  *
* USSTRATCOM/J64213             | Voice (402)294-7360           *
* 901 SAC Blvd, Suite 2B24      | FAX   (402)294-7912           *
* Offutt AFB, NE 68113-6600     | Proud member of Team Ada      *
* Opinions expressed here are my own _so_,  TTFWTW              *
*****************************************************************



             reply	other threads:[~1994-12-05 18:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-12-05 18:27 Bennett, Chip (KTR) ~U [this message]
  -- strict thread matches above, loose matches on Subject: below --
1994-12-02 11:40 Filename comparison ... HELP NEEDED! Nigel Jewell
1994-12-02 15:14 ` Frank Pilhofer
1994-12-02 16:53 ` Tanmoy Bhattacharya
1994-12-05  8:00   ` Nigel Jewell
1994-12-12  7:50 ` Lachlan Roche
1994-12-12 15:28   ` David Emery
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox