Short filename format returned as temp file name

C

Claire

When I call the Path.GetTempFileName() function I'm getting the following
file path returned.
C:\DOCUME~1\CLAIRE~1.JFM\LOCALS~1\Temp\tmp51.tmp

For some reason, when the temp file's opened, it's creating the following
path "C:\documents and settings\claire~1~jfm\locals~1\temp" It should be
"c:\Documents and Settings\ claire.smith.jfmom\local settings\temp"
Is this because Windows XP has decided to create my user directory from my
login name plus the domain? (claire.smith.jfmom) and the result's too
complex to be restructured from short into the correct long path name later?
I really don't like this ugly mess, can I create the correct file path
somehow?

thanks
 
G

Guest

Ahmed , Thank you very much . but I meet a problem just like the author said "
However, it's not always convenient to work with the short path names and
..NET provides no built in way to get the long path name. " ....
 
W

Willy Denoyette [MVP]

Claire said:
When I call the Path.GetTempFileName() function I'm getting the following
file path returned.
C:\DOCUME~1\CLAIRE~1.JFM\LOCALS~1\Temp\tmp51.tmp

For some reason, when the temp file's opened, it's creating the following
path "C:\documents and settings\claire~1~jfm\locals~1\temp" It should be
"c:\Documents and Settings\ claire.smith.jfmom\local settings\temp"
Is this because Windows XP has decided to create my user directory from my
login name plus the domain? (claire.smith.jfmom) and the result's too
complex to be restructured from short into the correct long path name
later? I really don't like this ugly mess, can I create the correct file
path somehow?

thanks
Check this, and be warned!
http://blogs.msdn.com/oldnewthing/archive/2004/12/24/331750.aspx

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top