Windows passes filename in 8.3 format and not in long format to tcl script 
Author Message
 Windows passes filename in 8.3 format and not in long format to tcl script

Hi All,
In explorer, i want to right click on a file and get a program to
run and process the file.
I am using tcl to process the file.

The problem is that windows NT is passing the file name in 8.3 format instead
of preserving the long file name.

My tcl script cant open the file if it is in the short 8.3 format.

I have added some entries into the registry to run the tcl script with the file
as the argument.

REGEDIT4
[HKEY_CLASSES_ROOT\*\shell]
[HKEY_CLASSES_ROOT\*\shell\View Revisions]

ANyone have any ideas/

Thanks
Derek



Tue, 09 Sep 2003 22:16:51 GMT  
 Windows passes filename in 8.3 format and not in long format to tcl script

Quote:

> In explorer, i want to right click on a file and get a program to
> run and process the file.  I am using tcl to process the file.

> The problem is that windows NT is passing the file name in 8.3 format instead
> of preserving the long file name.

> My tcl script cant open the file if it is in the short 8.3 format.
        ...


First off, I would recommend putting quotes around the %1 to preserve
spaces in a filename.

Tcl can handle files in 8.3 format, so perhaps something else is
giving you a problem.  In any case, you can always request the
longname from a file.  See the example code snippet:

(Tcl) 55 % set dir [pwd]
C:/Program Files/Tcl
(Tcl) 56 % file attributes $dir
-archive 0 -hidden 0 -longname {C:/Program Files/Tcl} -readonly 0
-shortname C:/PROGRA~1/Tcl -system 0
(Tcl) 57 % file isdir C:/Progra~1/Tcl
1
(Tcl) 58 % set long [file attributes C:/Progra~1/Tcl -longname]
C:/Program Files/Tcl

  Jeff Hobbs                     The Tcl Guy
  Senior Developer               http://www.ActiveState.com/



Wed, 10 Sep 2003 03:29:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. DOS 8.3 filenames (how to remove long filenames header)

2. Windows 95 long filename format

3. looking for a pre-compiled CoST 2.2 (dll format) for tcl 8.3

4. Looking for the format of Long filenames

5. File in 8.3 format

6. Tcl/Tk 8.3 Potential Roadmap (LONG)

7. Windows Long Date Format

8. Block formatting script not working

9. Converting 8.3 filenames to long_filenames.ad?

10. getarg & 8.3 filename

11. tcl 8.3 expect on windows

12. DP for tcl 8.3 (Windows)

 

 
Powered by phpBB® Forum Software