Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Rename File is fail  RSS feed

 
Randika Isuru
Ranch Hand
Posts: 38
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
please any one can tell me why this code give me a output false
are there any thing wrong in my code i don't think so. please correct me



This code give me output : File renamed? false

Thanks...
 
Henry Wong
author
Sheriff
Posts: 22835
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Randika Isuru wrote:
please any one can tell me why this code give me a output false
are there any thing wrong in my code i don't think so. please correct me



This code give me output : File renamed? false




Try it from the command line. Create two files (anyway you like). And then try to rename one of the files to be the same as the name of the other file. You will notice that the operating system doesn't like that.

Henry
 
Randika Isuru
Ranch Hand
Posts: 38
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ohhhhhhhhh no!!!
i forget that
Thank you very much "Henry Wong"
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!