Boost logo

Boost :

From: Arjen Wagenaar (arjenw_at_[hidden])
Date: 2006-02-24 07:17:45


Hi Beman,

> PS: I'd like to hear from programmers using wide character file names. Are
> they working OK? Are they meeting your needs?

I have been updating a windows application (using MSVC7.1, 13.10.3077, and
the latest cvs) to support wpaths. It all works pretty much as expected and
it didn't take much time to make the changes.

Let me list a few things I've found so far.

== fstream_test asserts

All the tests pass, except for the fstream_test. Here's the output:

execute-test
..\..\..\bin\boost\libs\filesystem\test\fstream_test.test\vc-7_1\debug\threa
ding-multi\fstream_test.run
====== BEGIN OUTPUT ======
path tests:
 in test 1
 in test 2
 in test 3
 in test 4
 in test 4.1
 in test 5
 in test 6
 in test 7
 in test 8
 in test 9
 in test 10
 in test 11
 in test 12
 in test 13
 in test 14
 in test 15

wpath tests:
 in test 1
 in test 2
 in test 3
 in test 4
 in test 4.1
C:\cvs\boost\boost/test/minimal.hpp(122): exception "fopen.c(55) : Assertion
failed: *file != _T('\0')" caught in function: 'int __cdecl main(int,char
*[])'

== missing inline (multiple defined symbols)

There seems to be an inline missing in fstream.hpp (line 45) for the
narrow_path() call.

== openmode differences for path/wpath

I ran into a few calls where fs::ofstreams where opened in binary mode, but
the std::ios_base::out flag wasn't specified. This worked fine for paths,
but for wpaths this was giving asserts as the narrow_path() function
specifically checks for this flag.

  template<typename Path>
  void test_no_out_mode(Path const& p)
  {
    fs::remove(p);
    fs::ofstream str(p, std::ios_base::binary);
    BOOST_CHECK(!!str);
    BOOST_CHECK(fs::exists(p));
  }

  void test_out_mode_narrow()
  {
    test_no_out_mode(fs::path("new_file_narrow"));
  }

  void test_out_mode_wide()
  {
    // asserts, unless you specify std::ios_base::out as well
    test_no_out_mode(fs::wpath(L"new_file_wide"));
  }

Thanks again,

Arjen


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk