B4J Question Moving and/or Renaming Files

johnB

Active Member
Licensed User
Longtime User
Can't find anything about moving or renaming files on the hard drive. I know in unix they are one and the same and maybe in java also. Thanks if somebody can point me in the right direction.
 

johnB

Active Member
Licensed User
Longtime User
You can use File.Copy and then delete the old file.
AH Thanks for the reply but wasn't the one I was hoping for.
If I understand it, under DOS copying and deleting the files is a lot more inefficient than rename and/or moving it.
Maybe I should create a .bat file and run that after the program
I have 100,000 photos I want to rename and move??????
 
Last edited:
Upvote 0

billzhan

Active Member
Licensed User
Longtime User
I agree with johnB, when file(s) size(s) or number are large,it's not efficient enough to copy and del.
 
Upvote 0

johnB

Active Member
Licensed User
Longtime User
Not sure if I should create a new post for this????

I've tied to create a .bat file using File.WriteList

eg
for k = 0 to 100
Main.list4.Add(k)
next
File.WriteList(Main.startFolder , "Rename" & Main.txtFileNo & ".txt", Main.list4)

but it hasn't created a file where each .Add was shown as a new line in the .bat file.

I tried adding a CRLF to the end of each .Add - Main.list4.Add(k & CRLF) but this made no difference
 
Upvote 0

johnB

Active Member
Licensed User
Longtime User
Thanks Manfred, I've downloaded the library, will try later. I ran the test program and everything worked ok

Regards
 
Upvote 0
Top