awitt Posted February 10, 2009 Share Posted February 10, 2009 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 More sharing options...
jeffman Posted February 10, 2009 Share Posted February 10, 2009 Sounds like a server-side thing, although javascript can manage the front end. What server-side language do you prefer? Link to comment Share on other sites More sharing options...
awitt Posted February 10, 2009 Author Share Posted February 10, 2009 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 More sharing options...
jeffman Posted February 10, 2009 Share Posted February 10, 2009 Familiar, yes. Enough to be useful, no. :)It's a good thing you mentioned it, though. That changes your audience drastically. Link to comment Share on other sites More sharing options...
awitt Posted February 10, 2009 Author Share Posted February 10, 2009 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 More sharing options...
awitt Posted February 13, 2009 Author Share Posted February 13, 2009 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 More sharing options...
justsomeguy Posted February 16, 2009 Share Posted February 16, 2009 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 More sharing options...
awitt Posted February 18, 2009 Author Share Posted February 18, 2009 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 More sharing options...
justsomeguy Posted February 18, 2009 Share Posted February 18, 2009 Javascript won't be able to scan the files on the server, Javascript runs in the browser only. If it's a Windows server you may be able to use the Windows Script Host to run a script file. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.