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. Advertisements

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. Hugz
    Replies:
    3
    Views:
    691
    Harmit Jhajj
    Feb 25, 2004
  2. Kathy Burke
    Replies:
    1
    Views:
    509
    Ron Vecchi
    Jul 26, 2003
  3. Marina
    Replies:
    3
    Views:
    2,594
    Himanshu Dhami
    Aug 15, 2003
  4. Tom
    Replies:
    0
    Views:
    586
  5. =?Utf-8?B?QmlzaG95?=
    Replies:
    0
    Views:
    1,279
    =?Utf-8?B?QmlzaG95?=
    Dec 28, 2006
  6. Bogdan
    Replies:
    1
    Views:
    1,150
    Bogdan
    Jun 16, 2009
  7. Leon
    Replies:
    3
    Views:
    352
    TaeHo Yoo
    Nov 26, 2004
  8. Oran
    Replies:
    2
    Views:
    838
Loading...