Re: [dcdev] Text protocol draft
2003-12-04 6:14
Fredrik Tolf
Direct Connect developers <[email protected]>

 > I also agree, regexp is cool :) but I also think windoz users are more
 > familiar with standard windoz wildcards.

While that's true, I don't think it would be such a great problem to
translate glob patterns into regexes. Just replace '*' with '.*' and
'?'  with '.'.  Match ranges are just left as they are. The client can
do that before sending the search request.

Yes, that's right.

 > <very serious mode>
 > Why not using something more powerful like expression that can be
 > processed by perl ( you are not very far with your N~ and S> ). Only few
 > things are missing like &&, || or parenthesis.
 > </very serious mode>

I have nothing at all against using PCRE instead of POSIX RE, if
that's what you mean. And sure, I can most certainly agree to using a
full-sized expression syntax; a parser can be written in five minutes
using flex and bison anyway (and with a word based protocol, you
probably won't even need flex).

or if it is exactly a perl expression returning TRUE or FALSE, you can let it parsed by an embedded perl.

Basically, you just need to define some basic criterias that can be
specified by the syntax that don't use too much CPU, like substring
matching (or, rather, regex matching), size comparison, hash

what about:
N for name of the file
S for size of the file
H for hash of the file
T for type of the file

with this it is at least possible to build big query like
( N=~avi$ || N=~ogm$) && (T==video) && (S>450000000)

cool :)

(maybe some "" are needed somewhere)

 > With this, I agree to vote for your protocol :-)

Really? Are you serious?

I am always serious :) I am not a "binary protocol at all cost" guy.


DC Developers mailinglist