[comp.sys.mac.hypercard] Searching for

joes@idunno.princeton.edu (Joe Studholme) (11/06/90)

Hi.

  I am hunting for a way to get HyperCard to do the following:

    Search a volume
    Find all files that contain a given string  in their name  
    Return the path (the long filename) of each file for which we get a 
     "hit"

For example, Jake K. User types the string "Druid" and its the 'find' 
button. Hypercard will then search the hundreds of megabytes worth of 
files on our server.  After a (hopefully brief) pause, Jake is rewarded by 
seeing a scrolling list with the results; aka:
                      
                           ----------------------------
                           |  Druidic font            |
                           |   MacDruid               |
                           |   Druids and Dragoons    |
                           ----------------------------

He clicks on an item, and PRESTO - a copy is made, the file is run (or 
destroyed), or whatever.

Now, I would have thought that there would be an XCMD or XFCN by now that 
did this. But I can't seem to find one in my usual sources.  Any help 
would be appreciated...

            <Joe Studholme>
            <joes@idunno.princeton.edu>
            <CIT Advanced Applications Group>

ollef@sics.se (Olle Furberg) (11/06/90)

In <3846@idunno.Princeton.EDU> joes@idunno.princeton.edu (Joe Studholme) writes:

 >    Find all files that contain a given string  in their name  
  (---)
 >files on our server.  After a (hopefully brief) pause, Jake is rewarded by 


   Get a list of all files (with full pathname) on the server. Then put the
list into your HC stack and write some lines of HyperTalk to search for all
occurences of the searchstring in the list.

  You will need a CopyFileXFCN. You could also use MountUnmountXCMD to mount
and unmount the server within your script.

  I think that several disklibrarian programs could generate this sort of
lists. I assume that the there are not so much changements on the server, so
you only need to update the list every two weeks or something like that. 

a_dent@fennel.cc.uwa.oz.au (11/16/90)

In article <3846@idunno.Princeton.EDU>, joes@idunno.princeton.edu (Joe Studholme) writes:
> Hi.
> 
>   I am hunting for a way to get HyperCard to do the following:
> 
>     Search a volume
>     Find all files that contain a given string  in their name  
>     Return the path (the long filename) of each file for which we get a 
>      "hit"
> 
Some of you may recall my question some time ago if people were interested in 
a program for reconciling/cleaning up floppy archives.  It would compare file
modification dates, delete old versions etc.

My thoughts on implementation were to do this as a series of XCMDS (which I may
also incorporate into a compiled application) so these operations could be
carried out from Hypercard and FoxBASE+/Mac.

My initial thought was to return a filename each time but it would be fairly
easy to accumulate them as lines in a field, as you've described.


> 
> Now, I would have thought that there would be an XCMD or XFCN by now that 
> did this. But I can't seem to find one in my usual sources.  Any help 
> would be appreciated...
I've already written "getSysFoldPath" which returns the pathname of the 
currently active (Blessed) System Folder.  We use this in FoxBASE+/Mac 
applications for saving preference files.  The extensions mentioned above
wouldn't be too hard.  Mind you, I'm now booking commercial work as far ahead 
as March so it might take me a month to find an afternoon to do this :-)

>             <Joe Studholme>
>             <joes@idunno.princeton.edu>
>             <CIT Advanced Applications Group>
Andy Dent                     A.D. Software phone 09 249 2719
Mac & VAX programmer          94 Bermuda Dve, Ballajura
a_dent@fennel.cc.uwa.oz       Western Australia  6066     
a_dent@fennel.cc.uwa.oz.AU (international)