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

  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. 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. Dmitry Bond.
    Replies:
    2
    Views:
    618
    Dmitry Bond.
    Aug 24, 2005
  2. Hypo
    Replies:
    6
    Views:
    419
  3. Troy Simpson

    Fragment Caching inside page caching?

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

    Problems caching user contorl on page

    moondaddy, Apr 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    321
    Steven Cheng[MSFT]
    Apr 21, 2004
  5. JimLad
    Replies:
    3
    Views:
    921
    JimLad
    Jan 21, 2010
Loading...

Share This Page