← Back to team overview

zorba-coders team mailing list archive

[Bug 986580] [NEW] fs::lsdir() improvements

 

Public bug reported:

I noticed that this function was added.  There are a few of problems
with its implementation:

1. It forces the user to use a vector.  What if I want to use a list?
Or something else?

2. It uses std::string.  The majority of the Zorba code base uses
zstring.

3. It always reads the entire directory whether you want it or not.
(WHat if there are 10,000 files in a directory?)  Instead, it ought to
provide an iterator that you can stop any time you please.

4. After the initial check for an error from opendir(), the code doesn't
check for any subsequent errors, e.g., it does not check closedir() for
error.

** Affects: zorba
     Importance: Low
     Assignee: Paul J. Lucas (paul-lucas)
         Status: Triaged

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/986580

Title:
  fs::lsdir() improvements

Status in Zorba - The XQuery Processor:
  Triaged

Bug description:
  I noticed that this function was added.  There are a few of problems
  with its implementation:

  1. It forces the user to use a vector.  What if I want to use a list?
  Or something else?

  2. It uses std::string.  The majority of the Zorba code base uses
  zstring.

  3. It always reads the entire directory whether you want it or not.
  (WHat if there are 10,000 files in a directory?)  Instead, it ought to
  provide an iterator that you can stop any time you please.

  4. After the initial check for an error from opendir(), the code
  doesn't check for any subsequent errors, e.g., it does not check
  closedir() for error.

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/986580/+subscriptions


Follow ups

References