Re: Problem with java Rename function in solaris platform.



I giving here the code part:
------------------------------------------
String l_stTMPCopyFile = l_stPERmtpath + "/" + l_stTMPFileNm + ".TMP";
File l_TMPFile = new File(l_stTMPCopyFile);
boolean l_bTMPCopy = l_stSrcFileNm.renameTo(l_TMPFile);
........................................................................................................................................

here actually the renameTo function failed while trying to move the
files local disk to the externally mounted disk in Solaris platform.But
in case of moving files within the local disk the function worked
properly.
Thanx for the reply...............
Roedy Green wrote:

On 9 Mar 2006 22:09:44 -0800, drajibneed@xxxxxxxxx wrote, quoted or
indirectly quoted someone who said :

the operation was quite successfull,but in case of moving the
files(using rename() function) from local to external disk,operation

Rename is just that. It goes into the directory and changes the name
of the file leaving the data part alone. This gives the illusion of
moving the file to a different spot on the same drive. It is not
intended for moving files from drive to drive. A move is a copy
followed by delete.

There are several ways to move files.

1. use http://mindprod.com/products.html#FILETRANSFER to copy files
then use File.delete.

2. exec a platform specific script that does it. see
http://mindprod.com/jgloss/jgloss/exec.html.

3. use FileInputStreams to such files into ram and squirt them out
with FileOutputStreams. Works if files not that big.
http://mindprod.com/applets/fileio.html


--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

.



Relevant Pages

  • Re: Power user policy to change local disk name
    ... Who needs a "reghack"? ... To rename a local disk, open My Computer, right-click ... When the properties sheet ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Changing "Local Disk" to something else
    ... You can RENAME a drive.. ... Computer and in the folders view of Windows Explorer with the name "Local Disk". ... I can't find that character string in the registry nor do I see anywhere in the Computer Manager | Disk Management where this name is assigned to that drive. ...
    (microsoft.public.windowsxp.customize)
  • Re: New Volume?
    ... You should be able to rt click the D: drive Icon in MyComputer and ... select Rename and type in local disk. ... I prefer the drive letter first. ...
    (microsoft.public.windowsxp.general)