Short filename format returned as temp file name

  • Thread starter Thread starter Claire
  • Start date Start date
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
 
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. " ....
 
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.
 
Back
Top