edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] use glob for directory scan
@ 2015-04-18  8:51 Karl Dahlke
  0 siblings, 0 replies; only message in thread
From: Karl Dahlke @ 2015-04-18  8:51 UTC (permalink / raw)
  To: Edbrowse-dev

As per my last email, I now use glob() to scan all the files in a directory.

1. The \\ bug is finally gone.
There is no trouble reading the contents of a directory a\b

2. The entries are already sorted,
I can remove the code that I wrote to sort them.

3. I can set a flag to show hidden files.
This use to require two calls to wordexp, for * and .*,
then merging the results.

4. There are only 5 literals to protect from glob: \ * ? [ ]
Combine this with the above and the code is simpler and more predictable.

This does not require me to replace wordexp with glob in the expansion of a filename.
They are separate capabilities.
However, encouraged by this early success,
I will probably do it, because file expansion
will also be free of the \\ bug, and will be free of all that silly escaping
that I would have to do every time I use it,
like the example in my documentation
$phones/at\&t
There would be no need for the backslash here, just write filenames intuitively.

Karl Dahlke

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-18  8:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-18  8:51 [Edbrowse-dev] use glob for directory scan Karl Dahlke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).