Menu

#171 Special file NUL is missing

0.61
closed
Qbix
5
2012-09-07
2004-02-05
No

I have a DOS batch script that checks if a directory
exist using the construct:

if not exist C:\Path\to\Dir\NUL echo Errror - missing
dir.

It seems like DOSBox 0.61 does not provide the special
file NUL, since the condition is always false.
--
Jan Bruun Andersen / MiniMax

Discussion

  • Qbix

    Qbix - 2004-02-06

    Logged In: YES
    user_id=535630

    Interresting I never knew it existed in the first place :)

    Isn't that hard to add.

     
  • Javier Juan

    Javier Juan - 2004-02-09

    Logged In: YES
    user_id=781990

    In fact, there are others special files than NUL. (Fast
    remembering...):

    con -> Keyboard input only.
    nul -> nul file.
    aux -> Assigned sometime to COM ports or other ports.
    prn -> Printer port, normally LPT1...

    And this special files are present normally (on msdos) as
    files existing in all directories. The nul file works as
    /dev/null in UNIX,
    and some games don't works if it don't exists (Many old
    Borland-compiled games without debug information stripped
    sends debug information to nul, crashing DOSBox)

     
  • Jan Bruun Andersen

    Logged In: YES
    user_id=584384

    Thanks QBix,

    You have to be aware of a slight quirck with those special
    files. The are more like special devices, e.g. they should
    really be called CON:, NUL:, AUX: and PRN:.

    So the command 'COPY FILE.TXT C:\TEMP\NUL:' and 'COPY
    FILE.TXT C:\NUL' will both succeed.

    But 'IF EXIST C:\TEMP\NUL: ECHO YES' will fail!!! Don't
    know why, but that's how it is.

     
  • Jan Bruun Andersen

    Logged In: YES
    user_id=584384

    FYI: http://vogons.zetafleet.com/viewtopic.php?p=31731#31731

    Seems someone has already been tinkering with this.

     
  • Qbix

    Qbix - 2004-09-15

    Logged In: YES
    user_id=535630

    The file nul has been added. This enabled BC3000AD to start up

    Constructions like if exist nul don't work though as our
    find routines don't look for devices.

     
  • Qbix

    Qbix - 2008-05-03

    Logged In: YES
    user_id=535630
    Originator: NO

    I added searching for devices for the find routines as well. This bug should now be fully fixed.

     

Log in to post a comment.