Hey All!

The other option is to write a (apple?)script to do a search or directory
listing. Then run that as an external action. I believe that <@var
request$resultset> inside the results portion of the external action will
contain the console output from the external action, so you could then parse
out the the filenames.

I'm not sure if there's any easy way to do the parsing. Last time I checked
(in about 2000) the <@regex> tag didn't work well or was buggy or something
(I can't remember), so you'll probably have to use a method similar to what
Wayne is using to parse out his file.

Hope this helps!

Cheers,
Jonah Simpson

----- Original Message ----- 
From: "Wayne Irvine" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 19, 2004 12:27 AM
Subject: Re: Witango-Talk: List of files in a folder


>
> > I need to list any files in a particular folder and assign the list to
an
> > array.
> >
> > Is there a way of doing this in Tango 2000 on a Mac running OS 9?
>
>
> Here's how I did it:
>
> First, I set up the webserver to give a directory index, then I use the
@URL
> tag to load the HTTP into a VAR.
>
> <@ASSIGN NAME=FileListPage Value=<@URL
> Location="http://www.thedomain.com.au/isellit/updatefiles/index.dir";>
> SCOPE=local>
>
> Then I parsed that VAR to extract all the .TXT files (I know the length so
> it was easy) in a while loop. Each file name is delimited by [ROW].
>
> While <@LOCATE STR=<@VAR local$FIleListPage> FINDSTR=".TXT"> !=0
>
> <@ASSIGN NAME=CurrPos VALUE=<@CALC EXPR='<@LOCATE STR=<@VAR
> local$FileListPage> FINDSTR=".TXT">-11'> SCOPE=local>
>
>
> <@ASSIGN NAME=FileList VALUE='<@VAR local$FileList><@SUBSTRING STR=<@VAR
> local$FileListPage> START=@@local$CurrPos NUMCHARS=15>[ROW]' SCOPE=LOCAL>
>
> <@ASSIGN NAME=FileListPage VALUE=<@RIGHT STR=<@VAR local$FileListPage>
> NUMCHARS=<@CALC '<@LENGTH STR=<@VAR local$FileListPage>>-<@VAR
> local$CurrPos>-15'>  SCOPE=LOCAL>>
>
> Then I loaded the resulting string as an array into another VAR
>
> <@ASSIGN NAME=FileListArray VALUE=<@ARRAY VALUE=<@VAR local$FileList>
> RDELIM='[ROW]' CDELIM='[COL]'> SCOPE=LOCAL>
>
> And removed duplicates using the DISTINCT tag
>
> <@ASSIGN NAME=DistinctFileListArray VALUE=<@DISTINCT
> ARRAY="local$FileListArray"> SCOPE=LOCAL>
>
> The only issue is that the index.dir only returns the first 100 records
but
> that is ok as this task is reiterative until there are no more .txt files.
>
> Wayne Irvine
>
>                   Byte Services Pty Ltd
>                http://www.byteserve.com.au/
>                   [EMAIL PROTECTED]
>    Ph 02 9960 6099   Mob 0409 960 609   Fax 02 9960 6088
>
> ________________________________________________________________________
> TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
>

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to