From: Thomas Demmer Newsgroups: comp.os.msdos.djgpp Subject: Re: How coould I know if two files are the same? Date: Thu, 28 Aug 1997 14:47:14 +0200 Organization: Lehrstuhl fuer Stroemungsmechanik Lines: 40 Message-ID: <34057352.7A91C0F0@LSTM.Ruhr-UNI-Bochum.De> References: <01IMY1B3EI4I00G6WZ AT cc DOT uab DOT es> NNTP-Posting-Host: c64.lstm.ruhr-uni-bochum.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk IBEC23 AT cc DOT uab DOT es wrote: > When a network disk drive X:\ is the same as M:\FOLDER, > my program "believes" that > X:\FILENAME.TXT > is different from > M:\FOLDER\FILENAME.TXT > but it is the same file. > > (X: and M: are two units mapped on some other computer > on my local net, but they are really in the same physical > hard disk. [...] > Xavier Pons Under any decent OS you'd simply stat() the files and compare inodes, under DOS and its PTFs this is one of the most intreaguing and challenging problems. Give your masochistic side a chance and look at stat.c to see to which pains it goes to find out if something is local or on a networked drive. For your particular setup, truename() ( _truename() ?) might be a solution, because WfW mapped drives and NetWare drives (when using VLM) are converted into \\server\path\file, regardless of mapping (Maybe with a bit of \ => / or vice versa, to make things not too easy). -- Ciao Tom ************************************************************* * Thomas Demmer * * Lehrstuhl fuer Stroemungsmechanik * * Ruhr-Uni-Bochum * * Universitaetsstr. 150 * * D-44780 Bochum * * Tel: +49 234 700 6434 * * Fax: +49 234 709 4162 * * http://www.lstm.ruhr-uni-bochum.de/~demmer * *************************************************************