Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!srhqla!demott!kdq From: kdq@demott.com (Kevin D. Quitt) Newsgroups: comp.os.msdos.programmer Subject: Re: How to determine if a file is in a root directory? Message-ID: <1990Dec5.014300.12510@demott.com> Date: 5 Dec 90 01:43:00 GMT References: <12201@life.ai.mit.edu> Reply-To: kdq@demott.COM (Kevin D. Quitt) Organization: DeMott Electronics Co., Van Nuys CA Lines: 49 >From: ralf@b.gp.cs.cmu.edu (Ralf Brown) Newsgroups: comp.os.msdos.programmer Date: 15 Sep 90 02:47:26 GMT Organization: Carnegie-Mellon University, CS/RI In article <2091@nyx.UUCP> cla@nyx.UUCP () writes: }How does one determine that two files are indeed the same physical file? Under DOS 3.0 and up, the easiest way is to apply the following undocumented function to both names and then do a string compare. INT 21 - DOS 3+ internal - RESOLVE PATH STRING TO CANONICAL PATH STRING AH = 60h DS:SI -> ASCIZ relative path string or directory name ES:DI -> 128-byte buffer for ASCIZ canonical fully qualified name Return: CF set on error AX = error code 02h invalid source name 03h invalid drive or malformed path others??? CF clear if successful AH = 00h AL = destroyed (00h or 5Ch or last char of current dir on drive) buffer filled with qualified name of form D:\PATH\FILE.EXT or \\MACHINE\PATH\FILE.EXT Notes: the input path need not actually exist letters are uppercased, forward slashes converted to backslashes, asterisks converted to appropriate number of question marks, and file and directory names are truncated to 8.3 if necessary. '.' and '..' in the path are resolved filespecs on local drives always start with "d:", those on network drives always start with "\\" if path string is on a JOINed drive, the returned name is the one that would be needed if the drive were not JOINed; similarly for a SUBSTed, ASSIGNed, or network drive letter. Because of this, it is possible to get a qualified name that is not legal under the current combination of SUBSTs, ASSIGNs, JOINs, and network redirections functions which take pathnames require canonical paths if invoked via INT 21/AX=5D00h supported by OS/2 v1.1 compatibility box SeeAlso: INT 2F/AX=1123h,1221h -- _ Kevin D. Quitt demott!kdq kdq@demott.com DeMott Electronics Co. 14707 Keswick St. Van Nuys, CA 91405-1266 VOICE (818) 988-4975 FAX (818) 997-1190 MODEM (818) 997-4496 PEP last