simple program to move files ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ajames270@gmail.com

    simple program to move files ?

    I would like to cretae a program to move files from one directory to
    another...
    ex:
    from c:\in
    to
    c:\out

    so anything in c:\in would be moved. I would like this to run every 30
    or 40 seconds.

    One other thing is I want to only get and move files that are fully
    written to the c:\in folder I dont want to start moving a file that is
    in process of being written to the directory.
    So can it be done to look by time and anyhting that is 30 seconds or 1
    minute in time older than current time?

    How would I do something like this?
  • cfps.Christian

    #2
    Re: simple program to move files ?

    Windows service that runs all the time. If you're dealing with a
    small amount of files you can use a file system watcher to watch the
    dir. Once you have that information you can do something to the tune
    of System.IO.File. Open([filename]) and if that throws an exception you
    know its not done and to get it on the next pass.

    If you're using a program to drop files into the "in" box you could
    have the application rename the file once it has been placed in and
    only grab the renamed files for the "out" box.

    Comment

    Working...