Go Back   FlashFXP Forums > > > >

! Requests Need a script or some sort of cool .bat file ? Ask here!

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-07-2011, 11:55 PM   #1
DJZacharia
Junior Member
 
Join Date: Apr 2008
Posts: 29
Default SITE FIND/SEARCH <file *keyword*>

Hello.

I am looking for a script that can search/find for files on my site, using keywords.
I should mention, i do not want a dupe script (that will block dupe files).
I've seen a script like this for drftpd and was wondering if someone could write a script that is similar.

it should look something like this:

Quote:
SITE FIND *keyword1*keyword2*keyword3*.mp3
[1] 200-.---------------------------------------------------------------------.
[1] 200-| FILES FOUND |
[1] 200-| Date | Files |
[1] 200-|------------------------------------------------------------------------|
[1] 200-| 2011-05-05 | /MP3/0505/VA-ALBUM_NAME-2010/04-artist-keyword1_(refix)_ft._keyword2.mp3 |
[1] 200-| 2011-05-05 | /MP3/0505/VA-ALBUM2_NAME-2011/02-artist-long_keyword1_keyword3.mp3 |
[1] 200-|------------------------------------------------------------------------|
[1] 200-| Displayed 2 of 2 matching found results. |
[1] 200-'------------------------------------------------------------------------'
please help me with this.
thanks
__________________
ioFTPD-v7.7.3 || ioNiNJA.Alpha.v0.8.0.9-2009-05-08 || nxTools-v1.2.1 || nxAutoNuke-v2.5.1 || nxtools-tempfix-2008-09-29 || ioJN
DJZacharia is offline   Reply With Quote
Old 05-08-2011, 03:47 AM   #2
Yil
Too much time...
FlashFXP Beta Tester
ioFTPD Administrator
 
Join Date: May 2005
Posts: 1,194
Default

I think I can get the functionality you want if you just play with your configuration a bit

First off, nxTools has the ability to track the names of all files so it can reject duplicates, but it doesn't bother to do so unless you have enabled dupe checking of files. So go do this now in your nxTools.cfg file:

Code:
set dupe(CheckFiles)    True
Also make sure you have enabled filename scanning during database rebuilds for all paths via:

Code:
set dupe(RebuildPaths) {
  {{/}  {d:/site}  True True}
}
The second true means you want to update the file database. Now go double check all the paths match those in the .vfs file.

Now for the tricky part! If you have the following settings:
Code:
set force(NfoFirst)     False
set force(SfvFirst)     False
set force(SampleFirst)  False
Then all you need to do is comment out the following line in ioFTPD.ini and you are done:
Code:
[FTP_Pre-Command_Events]
; stor = TCL ..\scripts\nxTools\nxDupe.tcl PRESTOR
However, if you have any of the force file options set then you can't comment out the line without loosing those features, so you'll need to edit nxTools/nxDupe.tcl and change this:
Code:
        PRESTOR {
            set virtualPath [PathNormalizeEx $user $group $pwd [join [lrange $argList 2 end]]]
            if {[IsTrue $force(NfoFirst)] || [IsTrue $force(SfvFirst)] || [IsTrue $force(SampleFirst)]} {
                set result [ForceCheck $virtualPath]
            }
            if {!$result && [IsTrue $dupe(CheckFiles)]} {
                set result [CheckFiles $virtualPath]
            }
        }
to this:

Code:
        PRESTOR {
            set virtualPath [PathNormalizeEx $user $group $pwd [join [lrange $argList 2 end]]]
            if {[IsTrue $force(NfoFirst)] || [IsTrue $force(SfvFirst)] || [IsTrue $force(SampleFirst)]} {
                set result [ForceCheck $virtualPath]
            }
        }

After making these changes, you'll need to import all the filenames be rescanning the directories via "SITE REBUILD".

When that is done, you can use 'SITE FDUPE [-max <limit>] <filename>' just like you can use 'SITE DUPE [-max <limit>] <release>'. I know the documentation says it matches specific releases or files, and you need to use 'SITE SEARCH' instead, but I happen to know it's the same function so it will wildcard search.

You can modify how FDUPE outputs the results by editing the scripts/nxTools/text/FileDupe* files...

I'd also like to suggest you backup your configuration before trying this just in case it doesn't work. Assuming your footer is accurate and you are using v6.9.3 I would suggest you bite the bullet and do the HUGE upgrade to v7.7.1. I know it's a lot of work to redo/merge the ioFTPD.ini file, but it's probably worth it for you. Once you have done that you can check out the source\nxSearch.itcl script by copy it to the scripts dir, and searching for the name in ioFTPD.ini and enabling it. I find using the /Search dir very helpful since it provides links right to the item so you can just click on the dir you want. This script is similar to the older ioNxSearch in v6.x but v7 provides you the ability to have multiple scripts and a bunch of new features. If you find you like the feature let me know and I can tweak the script to search for files instead of dirs so you could have a /SearchFiles auto-linking search script. I'm not sure, but I think you could then just download the files right from the returned virtual listing.
Yil is offline   Reply With Quote
Old 05-08-2011, 02:06 PM   #3
DJZacharia
Junior Member
 
Join Date: Apr 2008
Posts: 29
Default

Thanks, Yil. That worked great

I am planning to upgrade to v7.7.1, sometime within the next month or so (need to dedicate a few days to doing it, when i am off frmo work).

Thanks again for you help
__________________
ioFTPD-v7.7.3 || ioNiNJA.Alpha.v0.8.0.9-2009-05-08 || nxTools-v1.2.1 || nxAutoNuke-v2.5.1 || nxtools-tempfix-2008-09-29 || ioJN
DJZacharia is offline   Reply With Quote
Old 05-10-2011, 02:49 PM   #4
FTPServerTools
Senior Member
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: Sep 2002
Posts: 543
Default

Or use my site search http://tinyurl.com/freeftpservertools/files which works on command line..

ioFTPD setup:
edit ioFTPD.ini and add under [FTP_CustomCommands]
SEARCH = %EXEC ..\scripts\sitesearch.exe TIMEOUT=5000 START="%[$path]"

ioFTPD and ftp client side effects:
if the query takes too long your client will return without a result. To avoid that use the TIMEOUT=.
etc.. just read the text file..
FTPServerTools is offline   Reply With Quote
Reply

Tags
200-|, files, script, search find, [1]

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:51 AM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)