Detect files in a folder as and when created

Can anybody help me to make a program that detects a file and add its file name, date created & date modified into a database (xxx.mdb) as and when it is created.

I am a mere beginner and the purpose is to make a pgm that will pop up and ask for a description of the file and save it to a database along with its filename and date created and date modified.
It must allow the user to search and find the file specified by name or any other above said fields.

I'd like to be helped at detecting the file when it is saved using Photoshop as *.jpg.

Comments

  • : Can anybody help me to make a program that detects a file and add its file name, date created & date modified into a database (xxx.mdb) as and when it is created.
    :

    Well... what you need to do is remember the contents of the folder and then periodically check for updates. You can use the FileSystemObject to retrieve a list of files and save into in array, for example. Then after, say, 5 minutes, you do the same thing in a temporary array and check for differences. Whatever is not in the former array, is new.

    If the folder contains a lot files, or 5 minute interval is a waste of time and computing power, you can play around with the SHChangeNotifyRegister API function, which should send you a message when something happens to the folder. I need to do some experimenting to see how exactly it works. However, since you are a beginner, it would be difficult for you to use this, since you will also have to build a custom Window Procedure and hook it (subclassing) and so on and so forth.

    For now, try to use the manual change detection. If you are really interested in using the second, more complex method, let me know and I'll guide you through the subclassing and other stuff.

    Hope I helped,
    Nikolay Semov

  • : : Can anybody help me to make a program that detects a file and add its file name, date created & date modified into a database (xxx.mdb) as and when it is created.
    : :
    :
    : Well... what you need to do is remember the contents of the folder and then periodically check for updates. You can use the FileSystemObject to retrieve a list of files and save into in array, for example. Then after, say, 5 minutes, you do the same thing in a temporary array and check for differences. Whatever is not in the former array, is new.
    :
    : If the folder contains a lot files, or 5 minute interval is a waste of time and computing power, you can play around with the SHChangeNotifyRegister API function, which should send you a message when something happens to the folder. I need to do some experimenting to see how exactly it works. However, since you are a beginner, it would be difficult for you to use this, since you will also have to build a custom Window Procedure and hook it (subclassing) and so on and so forth.
    :
    : For now, try to use the manual change detection. If you are really interested in using the second, more complex method, let me know and I'll guide you through the subclassing and other stuff.
    :
    : Hope I helped,
    : Nikolay Semov
    :
    :
    Sir thank you very much for sending me a reply, I never hoped anybody would reply to a beginner like this.
    Let me try doing what you said. I hope your second method would be better as there is more than 2000 files (today) in the folder "F:photos " and files go on increasing day by day.
    I'd be glad if you could send me the code snippet for the same.

    With regards,
    Jithu
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories