Artifacts Associated With Ticket 714d37c3aa71d087
Ticket change [11d0a3c4d0] (rid 139752) by andy on 2014-09-09 04:51:33:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
I have some FTDI and CP2102 serial devices with so-called VCP (Virtual Comm Port) drivers in Windows. The first two worked, having been assigned names COM8: and COM9:. The third was called COM10:, but Tcl will not acknowledge its existence. I can talk to it in non-Tcl programs, including PuTTY.
- foundin initialized to: "ActiveTcl 8.6.1.0"
- is_private initialized to: "0"
- login: "andy"
- priority initialized to: "5 Medium"
- private_contact initialized to: "662c23482b0bf6a505f39e48fb7ad43af8dee4d3"
- resolution initialized to: "None"
- severity initialized to: "Critical"
- status initialized to: "Open"
- submitter initialized to: "andy"
- subsystem initialized to: "25. Channel System"
- title initialized to: "Cannot access COM10: and above in Windows"
- type initialized to: "Bug"
Ticket change [7784501c2b] (rid 139761) by twylite on 2014-09-09 14:01:27:
- icomment:
<p>"COM10:" is not a valid device name in Windows. As explained in the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx">MSDN entry for CreateFile</a>: "To specify a COM port number greater than 9, use the following syntax: "\\.\COM10". This syntax works for all port numbers and hardware that allows COM port numbers to be specified."</p> <p>In Tcl you have to escape those backslashes, so you would use [open "\\\\.\\$comport" r+].</p> <p>The Tcl docs are misleading in this regard; they say "An attempt to open a serial port that does not exist or has a number greater than 9 will fail. An alternate form of opening serial ports is to use the filename \\.\comX, where X is any number that corresponds to a serial port...". You can in fact open a serial port greater than 9 using the alternate form (only).</p>
- login: "twylite"
- mimetype: "text/html"
- username: "Twylite"
- icomment:
Ticket change [fc5828a1ed] (rid 139762) by andy on 2014-09-09 14:14:30:
- icomment:
Very nice, this works. I'm sorry I missed that in the documentation. Has anyone considered modifying the Tcl filesystem code on Windows to recognize COM10:, etc. as an alias for \\.\COM10? PuTTY apparently does this, or it uses an alternate interface to access the device that bypasses this naming restriction. I see Windows allows COM10 and beyond as valid filenames, whereas it rejects COM0 through COM9. (Case insensitive.) Windows never allows names ending in colon, so maybe we could only apply this translation to names ending in colon, as I proposed above.
- login: "andy"
- mimetype: "text/plain"
- username: "Andy Goth"
- icomment:
Ticket change [0876e82b04] (rid 139763) by twylite on 2014-09-09 14:35:10:
- icomment:
"Windows never allows names ending in colon" That is technically incorrect. A colon in a file name indicates access to an alternate NTFS stream within the file, and CreateFile() supports an lpFileName ending in a colon in at least some circumstances. Modifying the filesystem implementation imposes an overhead (albeit small) on all use to simplify an uncommon use case that is already platform specific (i.e. you don't open *nix serial ports using the "COMx:" name) and outdated (the "COMx:" x=1..9 DOS devices are supported in Windows for backwards compatibility). Introducing a Tcl-specific notion of a "COM10:" DOS device sounds wrong to me. The correct approach is to update the Tcl documentation to reflect the correct names for COM devices on Windows, i.e. {\\.\COMx}, rather than referring to the legacy DOS device names "COM1:", etc. When other application (like Putty) show you a "COM10:" they are using {\\.\COM10} internally; that is a UI issue. - login: "twylite"
- mimetype: "text/plain"
- icomment:
Ticket change [34b18dfeaa] (rid 139775) by andy on 2014-09-09 14:59:38:
- icomment: "Agree on all points."
- login: "andy"
- mimetype: "text/plain"
- username: "Andy Goth"
Ticket change [bd19392da2] (rid 139778) by oehhar on 2014-09-09 19:29:13:
- closedate changed to: "2456910.3119651"
- closer changed to: "oehhar"
- icomment:
So only the documentation request remains. This is documented in the open man page since a long time, see portability issues, Windows: [http://www.tcl.tk/man/tcl8.6/TclCmd/open.htm] So I close the bug. Thank you all, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Rejected"
- status changed to: "Closed"
- username: "oehhar"