Results 1 to 4 of 4

Thread: Overwrite new files

  1. #1

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Realise I have had a question today already, this one is to do with copying files from 1 location on a hard drive to another. & I am slightly

    I can use the fso.copyfile property to foce or leave overwriting files. That bit's fine. BUT....

    I have been asked for a third option of overwriting only files which are newer. Now I would class myself as an intermediate VB'er, but am stumped with this.

    I think I need to use the getfileinfo API call, but anyideas how to loop for each file in a directory, check it's version / modified object (not even sure which method to look at) & either overwrite or leave it ????

    PLEASE HELP ANYONE!!! Any small pointers of what I could look at / read into would help, thank you everyone!

    Alex Read


    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    If you are already using the FSO, then you can use the following properties of the File object.

    DateCreated
    DateLastModified

    Iain, thats with an i by the way!

  3. #3
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    use a file box with the local files in it


    for a = 0 to file1.listcount-1

    if dir(remotepath+file1.list(a))<> "" then

    if filedatetime(remotepath+file1.list(a))<> filedatetime(localpath+file1.list(a)) then
    kill remotefile
    copythefile
    end if

    else
    copythefile
    next a
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  4. #4

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Thumbs up response

    Thank you, both replies have helped!


    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

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