Topic: renameTo() does not work |
Print this page |
1.renameTo() does not work | Copy to clipboard |
Posted by: zuohaosh Posted on: 2004-01-16 16:28 代码如下 File in = new File(inputFileName); //inputFileName存在的目录 File err = new File(errorFileName); //errorFileName不存在的目录 in.renameTo(err); 我给了目录任何权限但in.renameTo()仍然返回false 我大概是有哪里错误 Thanks. |
2.Re:renameTo() does not work [Re: zuohaosh] | Copy to clipboard |
Posted by: learner Posted on: 2004-01-18 18:35 Have you given proper paths for inputFileName and errorFileName? Have you tried to rename it manually first? I would do that to make sure the OS allows it. From the same directory where the java program is run, "ren <old> <new>" or "mv <old> <new>" depending whether you are using Windows or Unix. Make sure you use the exact string representations for <old> and <new> as the ones used in the java program for "InputFileName" and "errorFileName" respectively. |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |