Search for file

Discussion in 'ASP General' started by jodleren, Jul 9, 2010.

  1. jodleren

    jodleren Guest

    Hi

    Does anyone have any idea how I can do a fast search for a file on
    server.

    Say, abc.def on \\server\someplace\

    I made ascript which uses about 6 minutes for 2200 folders, ~3GB.
    Windows does that in ~10 sec.

    How can I do that search a lot faster?

    Sonnich
     
    jodleren, Jul 9, 2010
    #1
    1. Advertisements

  2. jodleren

    jodleren Guest

    I found the IXSSO, searched for some examples, found none that worked.
    Any links please?

    Sonnich
     
    jodleren, Jul 9, 2010
    #2
    1. Advertisements

  3. jodleren

    Bob Barrows Guest

    Bob Barrows, Jul 9, 2010
    #3
  4. jodleren

    Dan Guest

    Windows uses the Win32 API functions. You would need to write a COM DLL to
    do the searching and call that from your ASP page. There are plenty of
    examples, search for Google for the FindFile API call.

    How are you searching at the moment?
     
    Dan, Jul 9, 2010
    #4
  5. jodleren

    jodleren Guest

    this way

    dim folderlist()
    set fso2 = CreateObject("Scripting.FileSystemObject")

    iListPos=0
    redim preserve folderlist(iListPos+1)
    folderlist(iListPos)=QDisk

    iCurrentPos=0
    response.write "list<br>"
    do while iCurrentPos<=iListPos
    Set f = fso2.GetFolder(folderlist(iCurrentPos))
    set ff = f.files
    For Each fname in ff
    if InStr(lcase(fname), item) then
    response.write "--Found: " & fname & "<br>"
    response.flush()
    end if
    next
    set ff=nothing
    Set ff = f.SubFolders
    For Each fname in ff
    iListPos=iListPos+1
    redim preserve folderlist(iListPos+1)
    folderlist(iListPos)=fname & "\"

    if InStr(lcase(fname), item) then
    response.write "--Found: " & fname & "<br>"
    response.flush()
    end if

    next
    iCurrentPos=iCurrentPos+1

    loop
    response.write iListPos & " folders tested"
     
    jodleren, Jul 9, 2010
    #5
  6. jodleren

    jodleren Guest

    Tried this, thanks
    I got something to work, but new questions.
    I searches in the files, not the file names :)

    Half way there, but still... I tried www.alltheweb.com for searching,
    (dont like google), but actually there is not much about IXSSO out
    there....

    I am looking for "lost" drawing numbers on a FTP disk - which is a
    server \\server\ftpfolder which also is not accepted by the IXSSO


    Sonnich
     
    jodleren, Jul 9, 2010
    #6
  7. jodleren

    Dan Guest

    <code snipped>

    Right, so you're using the FileSystemObject. I noticed your reply about
    IXSSO (by the way, I'd suggest if you want to find additional help with this
    that you at least consider using Google, you might not like it but it's a
    good way to find far more than ATW indexes), it will work with a network
    share if the server on which the share is located has the indexing service
    running.

    Other than that, all I can suggest is that you use the FindFile API and
    create your own COM DLL. There is sample code here:

    http://support.microsoft.com/kb/185476

    although you'll need to strip it down a bit.

    I have a small app that uses the FindFile API to search the image folders
    that are shared by all the web sites I run, and it will rattle through
    almost 3 million files spread across almost 100,000 folders in less than a
    minute (actual file size is irrelevant as for a simple search on filename
    the APIs will simply use the MFT), but if you feel the need to draw a
    comparison this is 55.6GB of data).
     
    Dan, Jul 12, 2010
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.