Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [stellation-res] File.renameTo()

> >-----Original Message-----
> >From: stellation-res-admin@xxxxxxxxxxxxxxx
> >[mailto:stellation-res-admin@xxxxxxxxxxxxxxx]On Behalf Of Mark C.
> >Chu-Carroll
> >Sent: August 24, 2002 7:15 AM
> >To: Stellation
> >Subject: Re: [stellation-res] File.renameTo()
> >
> >
> >On Saturday 24 August 2002 12:42 pm, Jonathan Gossage wrote:
> >> This API is not safe to use on any platform. It will never
> >succeed when a
> >> move across file system boundaries is required (e.g. between a
> >local file
> >> system and NFS) and on Windows it will fail when trying to
> >move a file from
> >> one directory to another. The failure is reported, not by an
> >exception, but
> >> simply by returning "false".
> >
> >I knew about the filesystem restriction, but not the windows restriction.
> >
> >We didn't consider the filesystem restriction to be a big deal.
> >Since the
> >workspace is created and maintained by Stellation, it shouldn't ever
> >be crossing filesystems. So moving things around within the workspace
> >should never cause a problem.
> >
> >Windows is a different situation apparently.
> >
> >> One solution would be to use the Unix mv command, natively
> >under Unix and
> >> under Cygwin under Windows. Another, and I feel better
> >solution, would be
> >> to implement an internal method that provides the necessary subset of
> >> functionality of the mv command.
> >
> >One solution would be to replace the File.rename with a copy to
> >the new location, and delete from the old.
> >
> >> Specifically this one bit me in TextArtifact.normalize(). It is nasty
> >> because the workspace file simply disappears and later processing fails
> >> with a FileNotFound exception because the workspace file is no longer
> >> present.
> >
> >Why did rename bite you in normalize?
> >
> >	-Mark
> >
> >--
> >Mark Craig Chu-Carroll,  IBM T.J. Watson Research Center
> >*** The Stellation project: Advanced SCM for Collaboration
> >***		http://www.eclipse.org/stellation
> >*** Work Email: mcc@xxxxxxxxxxxxxx  ------- Personal Email:
> >markcc@xxxxxxxxxxx
> >
> >
> >_______________________________________________
> >stellation-res mailing list
> >stellation-res@xxxxxxxxxxxxxxx
> >http://dev.eclipse.org/mailman/listinfo/stellation-res

Because I had test files that were not considered normalized by the code and
the attempt to move them using the renameTo() API failed resulting the
workspace copy being deleted and not being replaced by the normalized copy.

Regards

Jonathan Gossage

Personal Email
jgossage@xxxxxxxx

Business Email
jonathan@xxxxxxxxxxxxxx



Back to the top