Scan for new or modified files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gdubois@deloitte.vg

    Scan for new or modified files

    Hi all!

    Is there an easy way to scan files on network, and find out which
    files are new or modified? (VS2003, C#)

    I am trying to create a program to help myself manage the network.

    I am pretty sure some programs are available (backup programs) but I
    would like to do it myself... with help ;)

    Thanks

  • Oliver Sturm

    #2
    Re: Scan for new or modified files

    Hello gdubois,
    >Is there an easy way to scan files on network, and find out which
    >files are new or modified? (VS2003, C#)
    >
    >I am trying to create a program to help myself manage the network.
    >
    >I am pretty sure some programs are available (backup programs) but I
    >would like to do it myself... with help ;)
    Well, start by describing the problem you're having.

    Is it the scanning? You could use the System.IO.Direc tory class, which has
    a lot of methods to enumerate the content of directories, over which you
    can then iterate. Recursion is usually a good idea for an algorithm that
    needs to scan (parts of) the file system.

    Finding out whether it's new or modified? Well, obviously you'll have to
    store a previous state to make that comparison. To do that, you could use
    some form of database and store away the information you're interested in
    - names and timestamps for files and directories, or even checksums of
    files if you want to go so far as to compare the actual content (can be a
    time and resources consuming process, especially on network data). I'd
    recommend a database over, say, an XML file, because in file systems big
    amounts of data accumulate quickly and an XML file would soon be too big
    to handle with good performance. To calculate checksums, look at the
    hashing functionality in the System.Security .Cryptography namespace.

    Hope it helps...


    Oliver Sturm
    --

    Comment

    Working...