Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to convert long file name to short names windows.

Status
Not open for further replies.

AnsBGA

Technical User
Oct 11, 2002
5
US
Is there any standard procedure or other proc to convert long names returned by "file join" operation eg.
"c:/this is test/tt ab/*.gif"

to short names ( "c:/this~1/tt~1" ; may not be righ) that can be used in 8.3 to do the folloing.

set ok [dir $short_dir_name]

Thanks,
nick


 
This is about the time when we should ask why you are not using glob?
Whn you start having to worry about things that glob makes transparent..I think that maybe the dir method isn't right after all...
 
marsd,
Many thanks for you help and patience.

Here is the reason(below the ---- line). I do have an alternative but this would be great for my application. You gave me a good start and if and when I have a working proc I will post it back.

Thaks again.
-nick
------------------------------------------------
The Tcl glob command doesn’t match files in the archive. For example, if
you wrap the files images/card1.gif and images/card2.gif, the glob pattern
“images/*.gif” fails to match either of these files. If you have an application
that depends on the glob command to produce arbitrary lists of wrapped files,
you need to rewrite it to use explicit lists of wrapped files. If you use a variable
to contain the file list, one technique you can use is to set the value of the
variable when you wrap the application using the prowrap -code option. The
following example uses the Unix back-quote command evaluation and shell
filename expansion techniques to set the variable imageList to contain a list of
files in the wrapped images directory:
% prowrap myApp.tcl images/*.gif -code "set imageList [list ‘echo images/*.gif‘]"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top