#5152 closed Bugs (wontfix)
Inconsistent behavior of path.native() function
Reported by: | Owned by: | Beman Dawes | |
---|---|---|---|
Milestone: | To Be Determined | Component: | filesystem |
Version: | Boost 1.45.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Hi,
I have built the 32-bit and 64-bit Boost libraries on Windows, Fedora Linux and Solaris 10 x86 using the following options:
runtime-link=shared link=shared
I am noticing some difference in behavior with the path.native() function when I send it to a stream. To illustrate the problem, I'm attaching my test program test_path.cpp.
Here's the result of test_path.cpp on Windows:
Current directory path:
generic_string = "C:/Devel/projects/compiler_tests/test_path" native = "C:\Devel\projects\compiler_tests\test_path"
Parent of current directory path:
generic_string = "C:/Devel/projects/compiler_tests" native = "C:\Devel\projects\compiler_tests"
Here's the result of test_path.cpp on Fedora Linux:
Current directory path:
generic_string = "/home/Leo/Devel/projects/compiler_tests/test_path" native = /home/Leo/Devel/projects/compiler_tests/test_path
Parent of current directory path:
generic_string = "/home/Leo/Devel/projects/compiler_tests" native = /home/Leo/Devel/projects/compiler_tests
Here's the result of test_path.cpp on Solaris 10 x86:
Current directory path:
generic_string = "/home/Leo/Devel/projects/compiler_tests/test_path" native = /home/Leo/Devel/projects/compiler_tests/test_path
Parent of current directory path:
generic_string = "/home/Leo/Devel/projects/compiler_tests" native = /home/Leo/Devel/projects/compiler_tests
Please notice that in the 3 sets of results above, the Windows results show the native path enclosed in double quotes while it isn't on Fedora Linux and Solaris 10 x86.
Was this difference in behavior intentional or is it a bug?
Regards, Leo
Attachments (1)
Change History (3)
by , 12 years ago
Attachment: | test_path.cpp added |
---|
comment:1 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 12 years ago
What confused me to use the native() function in my test program is the fact that on Windows the string() function insisted on displaying in generic format. Even the native() function did the same unless I invoked the make_preferred() function on the path. Thank you for your explanation, I'm switching my test program back to using the string() function.
This was a real head scratcher!
While it might be nice to poison path::operator<<(), that isn't really a bug in class path so I'm closing this as "won't fix".
--Beman