Re: Problem with java Rename function in solaris platform.
- From: "Raju" <drajibneed@xxxxxxxxx>
- Date: 10 Mar 2006 01:55:51 -0800
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.
.
- Follow-Ups:
- Re: Problem with java Rename function in solaris platform.
- From: Roedy Green
- Re: Problem with java Rename function in solaris platform.
- From: Thomas Weidenfeller
- Re: Problem with java Rename function in solaris platform.
- From: Chris Uppal
- Re: Problem with java Rename function in solaris platform.
- References:
- Problem with java Rename function in solaris platform.
- From: drajibneed
- Re: Problem with java Rename function in solaris platform.
- From: Roedy Green
- Problem with java Rename function in solaris platform.
- Prev by Date: Re: ideas or work plzzz
- Next by Date: Re: passing utf strings to java from c in jni??
- Previous by thread: Re: Problem with java Rename function in solaris platform.
- Next by thread: Re: Problem with java Rename function in solaris platform.
- Index(es):
Relevant Pages
|