PDA

View Full Version : Scanning Folders and Moving Files based on file name



switzch
April 25th, 2005, 07:53 PM
I am not sure if this could be an application of girder or not, or if something already exists. I am downloading files all the time to one central folder. I would like a program to automaticly move and potentially rename these files based on their filename (ie. move anything with "news" in the filename to /news). Does a program like this exists, if not, i imagine gider can do it any ideas how?

birty
April 26th, 2005, 12:59 AM
you would have to use lua to do it

Promixis
April 26th, 2005, 05:07 AM
This is doable in G3 with Lua but the file management functions in G4 are vastly superior to G3. PM Ron to beta G4.

switzch
April 26th, 2005, 06:14 AM
Thanks Mike, I have PM'd ron.

I was hoping there was some program that already exists to do this.. Oh well!

VaioUserChris
April 26th, 2005, 08:21 AM
Here's a post on using Lua 3.0 File Input/Output functions. Further down on the post you'll also find information on using the File System Object through Lua.

http://www.promixis.com/phpBB2/viewtopic.php?t=9451&highlight=

Chris

switzch
April 26th, 2005, 08:48 AM
Thanks guys! I was able to do this in VBS.



on error resume next
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile "C:\Documents and Settings\user\Desktop\test\lost*.avi" , "C:\Documents and Settings\user\Desktop\lost"
objFSO.MoveFile "C:\Documents and Settings\user\Desktop\test\24*.avi" , "C:\Documents and Settings\user\Desktop\24"

Promixis
April 26th, 2005, 09:24 AM
Good. Note: you can do that within girder using luacom if you want to run that based on an event.

switzch
April 26th, 2005, 10:09 AM
Thats good to know.

Anyway to generate an event based on the creation of a file in a folder? This way anytime a new file appears Girder can trigger the event rather than just triggering it every 30min.

Thanks!