Results 1 to 9 of 9

Thread: Prob with big file renaming

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2004
    Location
    Belgium
    Posts
    77

    Prob with big file renaming

    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

  2. #2
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    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".
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2004
    Location
    Belgium
    Posts
    77
    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
    Last edited by choas; May 28th, 2004 at 04:33 AM.

  4. #4
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    Why don't you use the?

    Rename(OldName, NewName)

    Where NewName has the same path but just a different file name

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2004
    Location
    Belgium
    Posts
    77
    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

  6. #6
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    It might help if you posted the code that doesn't work. I've used 'Rename' without any problems.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2004
    Location
    Belgium
    Posts
    77
    VB Code:
    1. Dim oldname, newname As String
    2.  
    3.         oldname = x.Filename
    4.         newname = x.get_TTAG("TPE1") & " - " & x.get_TTAG("TIT2") & ".mp3"
    5.  
    6.         Rename(oldname, newname)

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Feb 2004
    Location
    Belgium
    Posts
    77
    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

  9. #9
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Hi.

    This might be a little overkill, but if NET can't handle it, maybe it time to look at API . Try looking at SHFileoperation in the help.

    I believe that is the one explorer uses.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width