comp.lang.ada
 help / color / mirror / Atom feed
From: fp@dionysos.rbi.informatik.uni-frankfurt.de (Frank Pilhofer)
Subject: Re: Filename comparison ... HELP NEEDED!
Date: 2 Dec 1994 15:14:12 GMT
Date: 1994-12-02T15:14:12+00:00	[thread overview]
Message-ID: <3bndk4$pt2@zeus.rbi.informatik.uni-frankfurt.de> (raw)
In-Reply-To: 3bn13h$jmo@speedy.cci.de

In <3bn13h$jmo@speedy.cci.de> jewell@cci.de (Nigel Jewell) writes:
>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).

 A stat() on any file will give you a device id and an inode. These values
can be used to identify a file. If you stat() both files, and both the device
id and the inode are equal, then you have the same file. Only, this does not
work with linked files (but with symlinks).

	Frank

-- 
 + Frank Pilhofer                             fp@informatik.uni-frankfurt.de +
 | Darmstaedter Str. 22                                                      |
 | D-63225 Langen, Germany                    RAD Host (PAL/NTSC video,UNIX) |
 +---------------------------------------------------------------------------+



  reply	other threads:[~1994-12-02 15:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-12-02 11:40 Filename comparison ... HELP NEEDED! Nigel Jewell
1994-12-02 15:14 ` Frank Pilhofer [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
1994-12-05 18:27 Bennett, Chip (KTR) ~U
replies disabled

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