problems with File and caching

Discussion in 'Java' started by Roedy Green, Oct 24, 2003.

  1. Roedy Green

    Roedy Green Guest

    I have discovered two rather unpleasant things about java.io.File.

    If you do a file.getFileLength you get the OLD file length, not the
    current length. I notice it in particular when I create a temp file,
    delete the old file and rename the temp to the old name.

    If you try to point two File objects at the same file, sometimes you
    get an error.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Oct 24, 2003
    #1
    1. Advertisements

  2. Roedy Green

    Roedy Green Guest

    On Fri, 24 Oct 2003 05:51:28 GMT, Roedy Green <>
    wrote or quoted :

    >If you do a file.getFileLength you get the OLD file length, not the
    >current length. I notice it in particular when I create a temp file,
    >delete the old file and rename the temp to the old name.


    Turns out this is not so. Sorry about that. It does not cache old
    results.
    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Oct 24, 2003
    #2
    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. Dmitry Bond.
    Replies:
    2
    Views:
    788
    Dmitry Bond.
    Aug 24, 2005
  2. Hypo
    Replies:
    6
    Views:
    677
  3. Troy Simpson

    Fragment Caching inside page caching?

    Troy Simpson, Jan 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    984
    Troy Simpson
    Jan 19, 2004
  4. moondaddy

    Problems caching user contorl on page

    moondaddy, Apr 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    401
    Steven Cheng[MSFT]
    Apr 21, 2004
  5. Gavin Pollock

    Caching problems in ASP.NET 2.0 beta 2

    Gavin Pollock, Dec 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,127
    Gavin Pollock
    Dec 7, 2004
  6. Neil Cooper
    Replies:
    2
    Views:
    326
    =?Utf-8?B?U2NvdHQgU2ltb25z?=
    Jan 25, 2005
  7. tshad

    Caching problems in IE

    tshad, Mar 25, 2005, in forum: ASP .Net
    Replies:
    13
    Views:
    837
    tshad
    Mar 30, 2005
  8. JimLad
    Replies:
    3
    Views:
    1,178
    JimLad
    Jan 21, 2010
Loading...