Serial Port - file does not exist if PWD is a network path - HELP

Serial Port - file does not exist if PWD is a network path - HELP

Post by Zone » Wed, 08 Nov 2006 05:17:06


Hi all...

I have several users sharing common tcl scripts over a netork, using
Windows XP, ActiveTcl V8.4.
The TCL script attempts to open a serial connection (COM1:) for
example.
One 'some' computers, not all, I see the following:

~~~~~~~~~~~~~~~~~
1 % pwd
//SomeNetworkPath/SharedFolder
2 % file exists COM1:
0
(bin) 3 % cd c:
(bin) 4 % file exists COM1:
1
~~~~~~~~~~~~~~~~~

I do not understand why the working directory being on the network
affects TCL's ability to see the com port. Any ideas would be greatly
appreciated!

/ Thanks
Matt
 
 
 

Serial Port - file does not exist if PWD is a network path - HELP

Post by mghembr » Wed, 08 Nov 2006 11:33:21

In article < XXXX@XXXXX.COM >,


Hmm. Not having access to a Windows machine here.. In Unix, com ports are
relative to the file system (/dev/cuan, or whatever they're called these
days).. Perhaps Windows XP ALSO has file equivalents for the COM Ports?

Just a guess. Have you tried:
file exists C:\COM1: (or C:\WINDOWS\COM1:)?

MH

 
 
 

Serial Port - file does not exist if PWD is a network path - HELP

Post by Zone » Sun, 12 Nov 2006 02:25:51

Thanks MH - but no luck with that either.

Must be a strange bug within TCL.
My workaround is just to change the working directory to c:\ before I
open the com port, and then return to the previous path. Everything
then works fine.

Cheers.
Matt
 
 
 

Serial Port - file does not exist if PWD is a network path - HELP

Post by Darren Ne » Sun, 12 Nov 2006 03:03:21


In Windows, the devices like "COM" and "PRT" are presented as if they
exist in every directory. (A hold-over from the days when there were
different system calls to access these devices, and hence had the names
hard-coded.)

It's possible that if your cwd is on a networked drive that isn't mapped
to a drive letter, the "com" device doesn't exist in that directory. You
might need to use the fully-qualified name to access it. (Said
fully-qualified name might not be obvious, however.)

--
Darren New / San Diego, CA, USA (PST)
"That's pretty. Where is it?"
"Channelwood."
"We should go there on vacation."
"..."
 
 
 

Serial Port - file does not exist if PWD is a network path - HELP

Post by Pascal Sch » Sun, 12 Nov 2006 06:06:25

The simplest trick to always be able to access COM and LPT ports on
Win2k and later (NT, perhaps?) is just to open:

open \\.\comX

where X is the port number. As a bonus, you're able to access port
numbers higher than 9.

That help?

- Pascal.