Jürgen Spitzmüller wrote:

> Looks good (also the erase part; I just didn't think of that).

Then I am going to commit it.

> The idea is the following: if the string exceeds MAX_PATH, then we know
> for sure that it is not the _part_ of a filename where we have to look
> further in the next lines, so we can cut off (it still can contain the
> part of a file name, but the chunk we are cutting cannot be part of that).

OK.

> Furthermore, we avoid a boost exception, because boost::fs obviously also
> checks for the length and compares with MAX_PATH.

This should not happen anymore, since fs::native should catch these cases.

> Ideally, this should indeed be bound to the OS, since on Linux (and some
> Windows variants IIRC) the path can very well be longer than 255 chars,
> and boost::fs should not throw in such cases (and it doesn't on Linux
> indeed).

Then the correct solution would be to introduce a os::max_path() function
that would give us the os dependant value.


Georg

Reply via email to