4NT, TCC/LE : "IF EXIST X:\NUL" always fails

Aug 30, 2008
2
0
Using 4NT or TCC/LE, the test:
IF EXIST X:\NUL ...
always fails.

Under CMD.EXE it is used to test the existence of drive X:
 

rconn

Administrator
Staff member
May 14, 2008
12,356
150
Here, it only fails if X: doesn't exist (or isn't ready). It behaves identically to CMD in every test I've tried -- can you give me an explicit example where it fails in TCC but works in CMD?

Rex Conn
JP Software
----- Original Message -----
From: rlsx
To: rconn@jpsoft.com
Sent: Saturday, August 30, 2008 7:34 PM
Subject: [Support-t-422] 4NT, TCC/LE : "IF EXIST X:\NUL" always fails


Using 4NT or TCC/LE, the test:
IF EXIST X:\NUL ...
always fails.

Under CMD.EXE it is used to test the existence of drive X:
 
May 20, 2008
11,411
99
Syracuse, NY, USA
On Sat, 30 Aug 2008 21:59:43 -0500, rconn <> wrote:


>Here, it only fails if X: doesn't exist (or isn't ready). It behaves identically to CMD in every test I've tried -- can you give me an explicit example where it fails in TCC but works in CMD?

I have an x: drive (physical, permanent, ready) and

TCC 9.02.151 Windows XP [Version 5.1.2600]
Copyright 2008 Rex Conn & JP Software Inc. All Rights Reserved
Registered to Vincent Fatica - 5 System License

v:\> if exist x:\nul echo yes

v:\>

While,

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

v:\> if exist x:\nul echo yes
yes

v:\>

It works for all root directories in CMD and for none in TCCv9. I have to go
back to 4NTv5 to see it work.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
vefatica wrote:
| On Sat, 30 Aug 2008 21:59:43 -0500, rconn <> wrote:
|
|
|
| ---Quote---
|| Here, it only fails if X: doesn't exist (or isn't ready). It
|| behaves identically to CMD in every test I've tried -- can you give
|| me an explicit example where it fails in TCC but works in CMD?
| ---End Quote---
| I have an x: drive (physical, permanent, ready) and
|
| TCC 9.02.151 Windows XP [Version 5.1.2600]
| Copyright 2008 Rex Conn & JP Software Inc. All Rights Reserved
| Registered to Vincent Fatica - 5 System License
|
| v:\> if exist x:\nul echo yes
|
| v:\>
|
| While,
|
| Microsoft Windows XP [Version 5.1.2600]
| (C) Copyright 1985-2001 Microsoft Corp.
|
| v:\> if exist x:\nul echo yes
| yes
|
| v:\>
|
| It works for all root directories in CMD and for none in TCCv9. I
| have to go back to 4NTv5 to see it work.

Test environments:

4NT 7.01.370 Windows XP [Version 5.1.2600]
4NT 8.02.106 Windows XP [Version 5.1.2600]
TCC 9.02.151 Windows XP [Version 5.1.2600]

Testing using command

for %d in (%_drives) (echo %d %@ready[%d] ^ if exist %d\NUL echo exist)

All 3 versions behaved identically; "exist" was never displayed. In all 3
versions I had an "exception processing" pop-up message for each drive that
was not ready, 1 for DVD-RW, 1 for CD-ROM, and 1 for each empty slot for SD,
etc. cards.

--
Steve
 

rconn

Administrator
Staff member
May 14, 2008
12,356
150
I have both an X: drive (physical) and a Y: (network mapped) and they both work with TCC v9.

The test is actually being done by Windows, not by TCC, so I suspect it's a configuration issue.

Rex Conn
JP Software
----- Original Message -----
From: vefatica
To: rconn@jpsoft.com
Sent: Saturday, August 30, 2008 11:55 PM
Subject: RE: [Support-t-422] 4NT, TCC/LE : "IF EXIST X:\NUL" always fails


On Sat, 30 Aug 2008 21:59:43 -0500, rconn <> wrote:



Quote:
>Here, it only fails if X: doesn't exist (or isn't ready). It behaves identically to CMD in every test I've tried -- can you give me an explicit example where it fails in TCC but works in CMD?

I have an x: drive (physical, permanent, ready) and

TCC 9.02.151 Windows XP [Version 5.1.2600]
Copyright 2008 Rex Conn & JP Software Inc. All Rights Reserved
Registered to Vincent Fatica - 5 System License

v:\> if exist x:\nul echo yes

v:\>

While,

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

v:\> if exist x:\nul echo yes
yes

v:\>

It works for all root directories in CMD and for none in TCCv9. I have to go
back to 4NTv5 to see it work.
 
May 20, 2008
11,411
99
Syracuse, NY, USA
On Sun, 31 Aug 2008 11:08:28 -0500, rconn <> wrote:


>I have both an X: drive (physical) and a Y: (network mapped) and they both work with TCC v9.
>
>The test is actually being done by Windows, not by TCC, so I suspect it's a configuration issue.

What API function do you use to invoke that test?

I don't think there's much Windows configuring that will affect NUL. I have
"NUL=\Device\Null" in

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices
 
May 20, 2008
11,411
99
Syracuse, NY, USA
On Sun, 31 Aug 2008 13:11:46 -0500, vefatica <> wrote:


>What API function do you use to invoke that test?
>
>I don't think there's much Windows configuring that will affect NUL. I have
>"NUL=\Device\Null" in
>
>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices

And device manager shows it enabled and working correctly.
 
May 20, 2008
11,411
99
Syracuse, NY, USA
On Sun, 31 Aug 2008 13:27:23 -0500, vefatica <> wrote:


>On Sun, 31 Aug 2008 13:11:46 -0500, vefatica <> wrote:


>---Quote---
>>What API function do you use to invoke that test?
>>
>>I don't think there's much Windows configuring that will affect NUL. I have
>>"NUL=\Device\Null" in
>>
>>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices
>And device manager shows it enabled and working correctly.
>---End Quote---

When I do this in a plugin

WCHAR szFile = L"x:\\nul";
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(szFile, &fd);
if ( hFind != INVALID_HANDLE_VALUE )
{
Printf(L"%s\r\n", fd.cFileName);
FindClose(hFind);
}

I get "nul".

If I change szFile to L"o:\\nul" (no drive o:) I don't get "nul".
 
May 20, 2008
11,411
99
Syracuse, NY, USA
On Sun, 31 Aug 2008 13:27:23 -0500, vefatica <> wrote:


>On Sun, 31 Aug 2008 13:11:46 -0500, vefatica <> wrote:


>---Quote---
>>What API function do you use to invoke that test?
>>
>>I don't think there's much Windows configuring that will affect NUL. I have
>>"NUL=\Device\Null" in
>>
>>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices
>And device manager shows it enabled and working correctly.
>---End Quote---

When I do this in a plugin

WCHAR szFile = L"x:\\nul";
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(szFile, &fd);
if ( hFind != INVALID_HANDLE_VALUE )
{
Printf(L"%s\r\n", fd.cFileName);
FindClose(hFind);
}

I get "nul".

If I change szFile to L"o:\\nul" (no drive o:) I don't get "nul".
 
May 20, 2008
11,411
99
Syracuse, NY, USA
My previous post was mailed only once (got SMTP delivery logs to show it) yet it appears here and in my mailbox twice.

And vBulletin changed my colon-right_paren to a smiley. Isn't that cute!
 
Aug 30, 2008
2
0
Here, it only fails if X: doesn't exist (or isn't ready). It behaves identically to CMD in every test I've tried -- can you give me an explicit example where it fails in TCC but works in CMD?
-------------
Windows XP + SP3
TCC LE 9.02.151

c:\> if exist c:\nul echo yes

c:\>
-------------
Another machine:

Windows XP + SP3 (French)
4NT 8.02.106

c:\> if exist c:\nul echo yes

c:\>
-------------

Needless to say, C: exists on both machines.
 
Jun 2, 2008
376
2
Newton, MA
There seem to be a lot of us for whom the exist test with NUL does not
work. Here's what my systems does (IFTEST is an alias that reports
whether the test returned true or false).

C:\>iftest exist c:\nul
FALSE

C:\>d:\

D:\>iftest exist d:\nul
FALSE

Obviously, both drives do exist.

-- Jay
 
May 20, 2008
11,411
99
Syracuse, NY, USA
When I "if exist x:\nul echo yes ...

I see that TCC ultimately uses FindFirstFile() which works here when given L"x:\\nul". I also see that first, QueryIsFileOrDirectory() is called with an argument L"x:\\nul" and then find_file() is called with an argument of L"x:\\"
(no "nul", is that right?) ... the fourth character of L"x:\\nul" had been replaced by a \0. And then, FindFirstFile() is called with an arg of L"x:\\" ... which is documented to fail.

Oddly, when I do this on a local drive, TCC proceeds to QueryIsFile(), find_file(), FindFirstFile() all with arg L"d:\\tcmd9\\tcc.exe".
 
May 20, 2008
603
0
Sammamish, WA
On Sat, Aug 30, 2008 at 7:59 PM, rconn <> wrote:

> Here, it only fails if X: doesn't exist (or isn't ready). It behaves
> identically to CMD in every test I've tried -- can you give me an explicit
> example where it fails in TCC but works in CMD?

My C: is a physical drive. D: is SUBST C:\RAM, E: is a CDROM, G: is
mapped to a Windows server. F: does not exist.

TCC fails in every case if the drive actually exists. TCC correctly
says F: does not exist. CMD gives the proper answer in all cases.

D:\>ver /r

TCC 9.02.151 Windows XP [Version 5.1.2600]
TCC Build 151 Windows XP Build 2600 Service Pack 3

D:\>type test.bat
if exist %1:\nul echo exist %1

D:\>echo %_drives
C: D: E: G: I: J: L: M: N: O: P: Q: R: S: T: U: W: Y: Z:

D:\>test c
if exist %1:\nul echo exist %1

D:\>test d
if exist %1:\nul echo exist %1

D:\>test e
if exist %1:\nul echo exist %1

D:\>test f
if exist %1:\nul echo exist %1

D:\>test g
if exist %1:\nul echo exist %1



D:\>ver

Microsoft Windows XP [Version 5.1.2600]

D:\>test c

D:\>if exist c:\nul echo exist c
exist c

D:\>test d

D:\>if exist d:\nul echo exist d
exist d

D:\>test e

D:\>if exist e:\nul echo exist e

D:\>test f

D:\>if exist f:\nul echo exist f

D:\>test g

D:\>if exist g:\nul echo exist g
exist g

D:\>


--
2008 Fridays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Saturday.
Measure wealth by the things you have for which you would not take money.
 
Similar threads
Thread starter Title Forum Replies Date
N Shortcut stops working after 4NT to TCC Upgrade Support 73
BobK New to TCC, Why does it use my old 4NT files? Support 3
rcjackson0926 TCC 11.0 vs 4NT copy and paste Support 2
S TCC 9.02 vs 4NT 8.02 difference - for %a COPY Support 6
D Peculiar symptoms w/ 4NT, TCC/LE vis a vis CMD.EXE Support 11
S Another 4NT 8.02 vs TCC 9.02 diff - MOVE command Support 3
S TCC 9.02 vs 4NT 8.02 TAB completion on FTP Support 7
G 4NT on Windows 10 Support 3
J 4NT V8.02 Registration on SSD Support 2
SB-Robert Old 4NT Won't Register - Options? Support 8
Kachupp old version 4nt v8 Support 0
Kachupp old version 4nt v8 Support 0
J 4NT problems after going to Windows 7 Support 5
A Installing 4nt on Windows 7 Support 3
S 4NT - delete from command prompt and recycle bin Support 12
W 4NT 8.00 Registration Question Support 7
J 4nt 5.0 Registration key won't work Support 6
A Issue with 4NT Support 7
A How to Run the 4NT 8.02 .INI Key Version Support 3
A 4NT 8.02 Installation on Windows 7 Support 1
Joe Caverly 4nt.exe Support 2
noahcoad Possible Bug? Launching 4nt.exe Goes Hairwire Support 10
W The skipping of remaining 4NT job steps Support 2
T TCv9.0 much slower than TCI v2.0/4NT Support 8
J 4NT Error when running 'system' from a program to execute a .BTM Support 3
G 4NT 9.02 _shell internal variable Support 50
S MOVE command over FTP with 4NT 5.00U Support 0
R 4nt v8 Support 1
MickeyF TCC crashing when copying multiple files (now resolved) Support 6
C COMSPEC constantly reset to TCC.EXE Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT v28 Released Support 0
C How to? starting TCC/TCMD v25 Support 2
CWBillow TCC and TCMD in Powershell Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.24 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.23 uploaded Support 0
Alpengreis Fixed Crash after copy dialog with big TCC.exception.log Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT v27.01 Build 22 Uploaded Support 0
L FTYPE in TCC, less quirky than in cmd.exe Support 3
V Set path permanently from within TCC? Support 3
DrusTheAxe Runaway TCC.exception.log filling drive Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.21 uploaded Support 0
Joe Caverly tcc.exception.log Support 3
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.20 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.19 Support 0
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
vefatica SCRIPT ... TCC disappears Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT v27.0.18 Support 0
Jesse Heines Access Denied errors in TCC 27 Support 9
fpefpe How to? tcc inifile (%_ininame) Support 3
M How to? Black TCC Prompt Support 2

Similar threads