I use this function to rename file :
System.IO.File.Move(Filename1, Filename2)
It work fine with small file like 5 or 6 mb, but when I try to use it on big MP3 album like 100mb it cause an error out of memory.
(PS : I have 1024 mb of RAM)
Thanks
Printable View
I use this function to rename file :
System.IO.File.Move(Filename1, Filename2)
It work fine with small file like 5 or 6 mb, but when I try to use it on big MP3 album like 100mb it cause an error out of memory.
(PS : I have 1024 mb of RAM)
Thanks
Couple things I can think of. Maybe your virtual memory (page file) size is set to low. Or possibly the temp directory is to full, I know that on NT4 I've had problems with the temp directory "filling up".
The prob doesn't come from there. And anyway it should be another way to rename a file that recopying him cause even if it's work with 80 90 mb file it ta ke long time. When U rename a file with windows right click, it just modify the name it took 1 sec.
There is a function officially classed as VB .NET funtion on msdn
here but when I try it like :
rename (oldfile, newfile)
it say too much argument for private sub rename :/
Thans if someoen can tell me another way
Why don't you use the?
Rename(OldName, NewName)
Where NewName has the same path but just a different file name
It seem you posted your reply at th same time I was editing mine lol
As I told just over this function doesn't work
It might help if you posted the code that doesn't work. I've used 'Rename' without any problems.
VB Code:
Dim oldname, newname As String oldname = x.Filename newname = x.get_TTAG("TPE1") & " - " & x.get_TTAG("TIT2") & ".mp3" Rename(oldname, newname)
Hmm sorry about the rename function it's my fault I have forgot I have already a function named Rename in my prog :/
The function work but it's still crashing when trying to rename large file (over 100mb). Which method is using widows to rename file in a seconde ?
Please I really need help to solve this
Hi.
This might be a little overkill, but if NET can't handle it, maybe it time to look at API :sick:. Try looking at SHFileoperation in the help.
I believe that is the one explorer uses.