Rename - Right

T

Thom Little

What a curious use of the word rename ...

It is stated that
string strA= Path.GetTempFileName();
creates a temporary file name in the temp directory and ...
Path.ChangeExtension( strA, "xxx" );
.... renames it.

What actually happens is that ...
string strA= Path.GetTempFileName();
.... creates a unique temporary file of length "0" and ...
Path.ChangeExtension( strA, "xxx" );
.... makes a copy of the file changing the extension to ".xxx".

You will start noticing this by the accumulation of zero-length "files"in
the temporary directory each having a length of zero.
 

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

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top