[comp.sys.ibm.pc] APPEND problem in MSDOS 3.3

bob@acornrc.UUCP (Bob Weissman) (05/13/88)

I've found what appears to be a rather serious bug in the APPEND
command of MS-DOS 3.30.

I issue the following commands from autoexec.bat:
	append /x
	append c:\word;c:\first

Then, if I put a virgin formatted diskette in drive A: and say dir a:,
I see all the files in c:\word, presumably because of the failure to
find any files matching a:*.*!  This leads to confusion for both
computer and user!

On the same topic, can someone explain the append /x switch better
than the manual?  I gather that only by issuing append /x the first
time will the current directory be searched before the appended
paths.  If I omit /x, then the current directory is never looked at?
This seems rather braindamaged, if I've interpreted it correctly.


-- 
Bob Weissman
Internet:	bob@acornrc.uucp
UUCP:		...!{ ames | decwrl | oliveb | pyramid }!acornrc!bob
Arpanet:	bob%acornrc.uucp@ames.arc.nasa.gov

johnl@ima.ISC.COM (John R. Levine) (05/14/88)

In article <781@acornrc.UUCP> bob@acornrc.UUCP (Bob Weissman) writes:
>I've found what appears to be a rather serious bug in the APPEND
>command of MS-DOS 3.30.
>
>I issue the following commands from autoexec.bat:
>	append /x
>	append c:\word;c:\first
>
>Then, if I put a virgin formatted diskette in drive A: and say dir a:,
>I see all the files in c:\word, presumably because of the failure to
>find any files matching a:*.*!  This leads to confusion for both
>computer and user!
>
>On the same topic, can someone explain the append /x switch better
>than the manual?  ...

APPEND is doing what you told it to -- the problem is the obscure
documentation for the /X switch. In the abscence of /X, append tells DOS to
look in the specified directories if a program tries to open a file and it's
not found in the current directory. Other functions, particularly the "search"
functions that DIR and other commands use to match patterns like *.* and the
EXEC call that runs a program, are unaffected. If, on the other hand, you give
the /X command to append, it does affect search and exec functions. That's why
if you get a directory listing after append /X, you'll see all of the files in
an appended directory if there's no match in the current directory. The /X
switch is usually unnecessary, and it's certainly confusing.

I've found that rather than using append, it's usually easier and safer to use
subst to aid in running old programs that don't know about directories.
Practically every program lets you specify a drive letter even if you can't
give a path, and subst lets you invent fake drive letters that correspond to
the directories that you need to get to. Unlike append, the subst'ed
directories are only used when you explicitly mention the fake drive letter.
This avoids the exciting situations where you forget what your append path is
and roach a file because it's not where you think it is.
-- 
John R. Levine, IECC, PO Box 349, Cambridge MA 02238-0349, +1 617 492 3869
{ ihnp4 | decvax | cbosgd | harvard | yale }!ima!johnl, Levine@YALE.something
Rome fell, Babylon fell, Scarsdale will have its turn.  -G. B. Shaw