From: Stewart, Robert (stewart_at_[hidden])
Date: 2002-01-24 10:30:58
From: Jani Kajala [SMTP:jani_at_[hidden]]
> Just uploaded the first version of path manipulation class (interface
A few comments.
- I suppose it is reasonable to allow for ".", "..", and "/" in pathname
strings as standard notation that might get translated into
platform-specific delimiters, but I wonder how folks that work on other
platforms would feel.
- I don't understand what an "abstract" pathname is.
- "ext" should be "extension."
- "last_modify" should be "last_modified."
- "last_access" and "last_modify" should return time_t's or something
standard for a time. Otherwise, what is the format of the long?
- In Unix, files have suffixes, not extensions, so I wonder whether there
should be a "suffix" mf, too.
- There are more attributes available, via stat(), under Unix than you have
accessors for. What if I want to know whether the sticky bit is set?
- There is no information available on file permissions.
- "list" is poorly named; how about "subdirectories?"
- "list" should take an output iterator, allowing the caller to determine
the most appropriate container type.
- Accepted terminology for pathname components are: pathname, filename,
basename, extension/suffix, parent, child, subdirectory.
- There appears to be no way to support multiple filesystems at runtime.
- "norm_case" should be a variant of "abstract." That is, "abstract" should
be overloaded or have a default parameter that controls whether to normalize
the pathname's case.
- In DOS/Windows, pathnames are case insensitive, but they are stored in
upper case, so "norm_case" returns the wrong case. Other case insensitive
platforms may conventionally use lower case, so this should be configurable.
- I don't understand what "norm_path" does that "abstract" doesn't. (I don't
know what either function does.)
There are only select operations for files or directories. I presume that
trying to get a list of subdirectories from a file will throw an exception,
but it suggests that you're combining incompatible things.
Instead, why not separate path manipulations from file/directory operations?
That is, create a path or pathname class that allows one to create and
decode pathnames, and separate classes for files and directories that
provide the operations one can perform on them.
Susquehanna International Group, LLP
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk