Article View: comp.os.msdos.programmer
Article #2238Re: "file cannot be copied onto itself"
From: Ralf Brown
Date: Sat, 15 Sep 1990 02:47
Date: Sat, 15 Sep 1990 02:47
41 lines
2613 bytes
2613 bytes
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
--
{backbone}!cs.cmu.edu!ralf ARPA: RALF@CS.CMU.EDU FIDO: Ralf Brown 1:129/3.1
BITnet: RALF%CS.CMU.EDU@CMUCCVMA AT&Tnet: (412)268-3053 (school) FAX: ask
DISCLAIMER? Did | Everything is funny as long as it is happening to
I claim something?| someone else. --Will Rogers
Technical Details
Message-ID:
<10478@pt.cs.cmu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!b.gp.cs.cmu.edu!ralfReferences:
<2091@nyx.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!b.gp.cs.cmu.edu!ralf From: ralf@b.gp.cs.cmu.edu (Ralf Brown) Newsgroups: comp.os.msdos.programmer Subject: Re: "file cannot be copied onto itself" Message-ID: <10478@pt.cs.cmu.edu> Date: 15 Sep 90 02:47:26 GMT References: <2091@nyx.UUCP> Organization: Carnegie-Mellon University, CS/RI Lines: 41