🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #2158

Re: File.renameTo() doesn't update object

#2158
From: Torsten Welches
Date: Mon, 07 May 2001 06:07
19 lines
1595 bytes
Owen,

a File instances represents merely a file's name, not the file
itself. While I agree that it's not that intuitive it's somewhat
consistent to how the File class works.

Torsten

"Owen Green" <owen@norobots.unique.com> wrote:
>or so it seems....
>
>When I call File.renameTo(), the file is indeed renamed on disk , but the
>object still returns the same values as before for getAbsaloutePath() etc.
>Does this mean that I should be retaining a reference to the file object I
>passed with the new file name?
>
>Is this behaviour docmented anywhere, and moreover, why does it behave this
>way??
Technical Details
Message-ID: <3af63baa$1_1@dnews>
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!feeds.vnews.net!nntp.cifnet.net!feed2.onemain.com!feed1.onemain.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3af1409d$1_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,a7b3eb68e6cc2342
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-05-06 23:24:05 PST
From: "Torsten Welches" <torsten.welches@who.cares.netcologne.de>
Sender: "Torsten Welches" <torsten.welches@who.cares.netcologne.de>
Reply-To: "Torsten Welches" <torsten.welches@who.cares.netcologne.de>
Subject: Re: File.renameTo() doesn't update object
Newsgroups: borland.public.jbuilder.java.api
X-User-Info: 193.158.55.74 193.158.55.74    
References:  <3af1409d$1_2@dnews> 
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3af63baa$1_1@dnews>
Date: 6 May 2001 23:07:38 -0700
X-Trace: dnews 989215658 207.105.83.65 (6 May 2001 23:07:38 -0700)
Lines: 19
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!feeds.vnews.net!nntp.cifnet.net!feed2.onemain.com!feed1.onemain.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews