[LLVMbugs] [Bug 3837] New: llvm::sys::Path API is flawed

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Mar 18 15:07:34 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=3837

           Summary: llvm::sys::Path API is flawed
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: System Library
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: daniel at zuster.org
                CC: llvmbugs at cs.uiuc.edu


The llvm::sys::Path API has a number of flaws. Some but not all of these may be
a matter of personal preference. :)

1. getBasename() is a poor name; it looks and sounds like basename() but is not
basename().

2. Appending a component to an empty path adds a separator. This is
inconvenient, and I don't think useful.

3. Path should expose a method to create a temporary file in the platforms
temporary file directory. It should include a method to include temporary files
by name; such a method isn't safe but some clients require it.

4. Path::exists is a liar, just because a program can't access a path doesn't
mean it doesn't exist.


The Python path module implements a portable OS path interface which in my
experience is quite clean and easy to use. I would recommend it as a reference.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list