[comp.sys.ibm.pc] A 4dos GOTCHA!

johnston@milton.acs.washington.edu (Craig Johnston) (04/13/90)

  I thought I'd post a little "GOTCHA!" that I ran in to the other day.
I apologize if this is old hat.

  I'm using 4DOS 3.0 as my command interpreter, and while installing
it, I had the need to temporarily move the config.sys file out of the
way.  No problem, I just entered 'move config.sys con.hld' in order to
rename it.  Well maybe you've guessed by now, but this had the effect of
writing the contents of the config.sys file to my screen and then erasing it.
Apparently the filename con.sys, was taken to mean CON, the console driver.
The extension had been ignored.

  Thinking I'd found a bug in 4DOS, I loaded up MSDOS's command.com and
tried the same thing using rename.  Sure enough command.com ignores the
extension after the device name as well.  With command.com the problem is
not as bad since there is no move command, and the rename command just
complains that you are trying to rename a file to one that already
exists (that is CON).

  I was able to recover the file using an unerase utility, so there was
no harm done, but I have to wonder why these two programs are built this
way.  It seems that if you are going to use a file-like model for devices,
you should carry it all the way.  After all, both 4DOS and command.com
can distinguish between the files 'test' and 'test.txt', why not 'con' and
'con.hld'?

  In case it isn't obvious the above is true for all the device file
names, AUX, PRN, COM1, etc.  As an aside, you can use this idea and a disk
editing utility like Norton's NU, to create file and directory names that are
particularly difficult to deal with.

  If any one has a comment or needs to set me straight, Email a response to,

	  johnston@milton.acs.washington.edu

  PS. 4dos is a wonderful program that is well worth using, and paying
      for!