Jump to content

File Watch


awitt

Recommended Posts

Hey guys, what's up. I need to write a script that monitors a folder containing video files. Based on the filenames, I will need to do a variety of things (e.g. truncate filename to specified length, append an incremental number sequence to distinguish like-titled files, delete a file if it were to meet certain criteria). Anyone want to help get me started?

Link to comment
Share on other sites

Sounds like a server-side thing, although javascript can manage the front end. What server-side language do you prefer?
I have to use JSPs. Are you familiar with those?
Link to comment
Share on other sites

Familiar, yes. Enough to be useful, no. :)It's a good thing you mentioned it, though. That changes your audience drastically.
well sir, thank you for asking that question. i hadn't thought it out far enough to realize that it would be a server-side task. i've reposted in the Java/JSP/J2EE forums.
Link to comment
Share on other sites

well sir, thank you for asking that question. i hadn't thought it out far enough to realize that it would be a server-side task. i've reposted in the Java/JSP/J2EE forums.
Well, turns out i can solve this problem using whatever language I wish. that said, does anyone have any ideas for a solution or at least are able to point me in the right direction?
Link to comment
Share on other sites

The basics are to set up a job to run the script, and set up the script. If you have a Linux server, you can use the cron tool to schedule a job to run whenever you want it to run. The job will be to execute a script, like a PHP script. The script can scan through the directory and do whatever you want with each file. For PHP, the scandir function will get the list of files and directories in a directory of your choice. You can use is_dir to test if it is a file or directory.http://www.php.net/manual/en/function.scandir.php

Link to comment
Share on other sites

Honestly, I'd rather use javascript if this can be done using that language. I'm just more familiar with it, so it'd be easier from that standpoint.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...