From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,47b9112afa553757 X-Google-Attributes: gid1164f8,public From: John Cushnie Subject: Re: f$search Date: 1998/09/03 Message-ID: <35EE82C3.501A2842@csi.com>#1/1 X-Deja-AN: 387556357 Content-Transfer-Encoding: 7bit References: <35EBBE2A.C84DCAD5@studio.disney.com> Content-Type: text/plain; charset=us-ascii Organization: John Cushnie Mime-Version: 1.0 Reply-To: cushnie@csi.com Newsgroups: comp.sys.dec Hi, You have to an indexed f$search, eg $ SEARCH_FILE = F$SEARCH(FILE_TO_DELETE, I_COUNT) Where I_COUNT is set to some integer. This is required where you want to keep the context of the search you are doing.... You can have multiple contexts (or indexed searches), but the whole thing gets pretty horrible.... Checkout the help on $ help lex f$search, or the examples in the DCL books. Hope this helps. John Cushnie email: cushnie@csi.com David Gray wrote: > i, > > I would like to be able to go through all files on a disk, that have an > eight > byte numeric extension and delete them. Iam trying to do this in a loop > using > f$search to find the file, then f$type to check if the extension is an > integer. > > My problem is that if I find an extension that is not numeric it needs > ignoring > and the next file checking using f$serach, however f$search will always > retrun > the next file in sequence, ie the one I have just checked. > > This example will probably explain what Iam trying to do better. > > $ FILE_TO_DELETE = UDISK1:*.%%%%%%%%;* > $ > $START: > $ > $ SEARCH_FILE = F$SEARCH(FILE_TO_DELETE) > $ FILE_EXT = F$ELEMENT(0,";",F$ELEMENT(1,".",SEARCH_FILE)) > $ EXT_TYPE = F$TYPE(FILE_EXT) > $ > $ IF EXT_TYPE .EQ. "INTEGER" > $ THEN > $ DELETE 'SEARCH_FILE;* > $ ENDIF > $ > $ GOTO START > $ > > No problems when file.12345674 is found this is deleted, but also > returned > is file.template which is not deleted so stays on top of the pile, the > next > search finds it again. > > Does anyone have a solution to this problem. > > Regards, > > David