opendir question
William Randall
wrandall at fptech.com
Tue Apr 5 19:40:41 PDT 2005
----- Original Message -----
From: "Howie" <howiewz at beonthenet.com>
To: <filepro-list at celestial.com>
Sent: Tuesday, April 05, 2005 9:57 PM
Subject: opendir question
> I've never used opendir before and find the help files less than helpful.
>
> Quoting the help screen:
>
> n = opendir("SCR_MASK", "fpcust")
> Return - list of all screens for the fpcust file
>
> In what is the list returned?
>
----------
One way is:
5.0 @DIRLIST_NAME Contains the format name as returned
This will also apply to NEXTDIR as you go through the directory listing.
Another is:
This is a clip of the code that we use in the Index Utilities to read and
create an index script for rebuilding all indexes. It might help with your
questions. Let us know if you need anything else.
The format of each file is:
Format Extension Size Date Time Fullname
32 10 14 10 9
32
Abcdefghijklmn abcdefghij 01234567891234 01/01/2000 12:12:34a -------
Bill
::x=OPENDIR() ' open the current working directory:
loop::aa=NEXTDIR() ' get the value of open dir:
:txt and aa eq "":close txt ; close dat ' reached end of file:
:aa eq "":x=CLOSEDIR() ; ij=""; goto done ' close out the list:
::bb=mid(aa,"1","32") ' read the filename:
:bb co ".":goto loop ' if the filename contains a period, discard:
:bb le lp and lp ne "":goto loop ' stop duplicate read on multiple
qualifiers:
::x=CLOSEDIR()' close to reset for sort:
::z=OPENDIR("IDX_MASK",bb)' create just index list:
::lp(32,*,g)=bb:
loop2::aa=NEXTDIR():
::cc=mid(aa,"1","5")' parse first 5 - 'index':
::ql=mid(aa,"6","27")' parse qualifier:
.......
Cross platform and you can read and parse each string. Windows is like
'dir' and NIX is like 'ls -l'
Hope that helps.
Bill
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.1 - Release Date: 4/1/2005
More information about the Filepro-list
mailing list