(directory) nonsence

Pondering the philosophy behind the language

(directory) nonsence

Postby CaveGuy » Wed Jun 14, 2017 5:49 am

first problem I put (directory) in the search box an it tells me it is too common ?

I change-dir to the directory with my log files and do a (directory) and get back a list of everything.
In this case I only want the dovecot logs so why does (directory "dovecot*") return nil ?

obviously too common a problem for search to be bothered responding with a hint.

Its late, I'm tired, what am I overlooking ?
Bob the Caveguy aka Lord High Fixer.
CaveGuy
 
Posts: 112
Joined: Sun Oct 13, 2002 3:00 pm
Location: Columbus Ohio

Re: (directory) nonsence

Postby TedWalther » Fri Jun 16, 2017 4:14 am

CaveGuy wrote:first problem I put (directory) in the search box an it tells me it is too common ?

I change-dir to the directory with my log files and do a (directory) and get back a list of everything.
In this case I only want the dovecot logs so why does (directory "dovecot*") return nil ?

obviously too common a problem for search to be bothered responding with a hint.

Its late, I'm tired, what am I overlooking ?


It is a regular expression. What you typed, matches dovecottttttttt. Probably not your intention. So try adding a . before the *. Like this:

Code: Select all
(directory "dovecot.*")
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.
TedWalther
 
Posts: 603
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC

Re: (directory) nonsence

Postby Lutz » Fri Jun 16, 2017 1:45 pm

The function 'directory' (as you use it) takes two arguments, the first is the path.
Only the second can take a regular expression for the filename:

http://www.newlisp.org/downloads/newlis ... #directory
Lutz
 
Posts: 5259
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: (directory) nonsence

Postby CaveGuy » Fri Jun 16, 2017 7:59 pm

I it dot'nt make ant difference still got nil. I ended up using (directory) followed with a do-list to remove everything I do not want.
thanks for the reply .

ps I missed the definitive reply before I posted this the first time ... my bad
Bob the Caveguy aka Lord High Fixer.
CaveGuy
 
Posts: 112
Joined: Sun Oct 13, 2002 3:00 pm
Location: Columbus Ohio

Re: (directory) nonsence

Postby TedWalther » Sat Jun 17, 2017 11:31 pm

CaveGuy wrote:I it dot'nt make ant difference still got nil. I ended up using (directory) followed with a do-list to remove everything I do not want.
thanks for the reply .

ps I missed the definitive reply before I posted this the first time ... my bad


Glad you were able to do what you wanted. Can you try one more time. My answer was wrong, I didn't notice the syntax error, which Lutz pointed out. Just cut and paste this:

Code: Select all
(directory "." "dovecot.*")
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.
TedWalther
 
Posts: 603
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC

Re: (directory) nonsence

Postby CaveGuy » Sun Jun 18, 2017 5:38 am

Thank that worked...
Went back and RTFM after catching up on some sleep, It makes more sense now then it did after several nights of manic programming looking for a pattern of twigs in a 7 million line haystack of access logs.
who would have guessed the trail would lead to Quasi Networks LTD in Seychelles a small island east of Africa and north of Madagascar. When I get a chance to clean up the spaghetti-ware and generalize it a bit. a multi RIR whois tracker client in newlisp will make an unusual real world example.
Bob the Caveguy aka Lord High Fixer.
CaveGuy
 
Posts: 112
Joined: Sun Oct 13, 2002 3:00 pm
Location: Columbus Ohio


Return to Whither newLISP?

Who is online

Users browsing this forum: No registered users and 1 guest

cron