Rename - Right

Discussion in 'ASP .Net' started by Thom Little, Aug 3, 2006.

  1. Thom Little

    Thom Little Guest

    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.
    --
    -- Thom Little -- www.tlanet.net -- Thom Little Associates, Ltd.
    --
     
    Thom Little, Aug 3, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    0
    Views:
    431
  2. =?Utf-8?B?QmlzaG95?=
    Replies:
    0
    Views:
    998
    =?Utf-8?B?QmlzaG95?=
    Dec 28, 2006
  3. Bogdan
    Replies:
    1
    Views:
    803
    Bogdan
    Jun 16, 2009
  4. Leon
    Replies:
    3
    Views:
    177
    TaeHo Yoo
    Nov 26, 2004
  5. Oran
    Replies:
    2
    Views:
    550
Loading...

Share This Page