Opened 19 years ago

Closed 19 years ago

#247 closed Bugs (Fixed)

Filesystem bug with rename

Reported by: wpcmame Owned by: nobody
Milestone: Component: None
Version: None Severity:
Keywords: Cc:

Description

There is a bug in the windows version of 
filesystem::rename. In the 
documentation it says:

-----
Source: !is_directory()
Target: is_directory()
The source file is moved to the target directory. 
----

The problem is that the function used "::MoveFileA" will 
either rename a file or a directory but it will not move a 
file to a directory. (Error "target already exists")

To move a file, the filname must also be in the target 
path.

Change History (1)

comment:1 by beman_dawes, 19 years ago

Status: assignedclosed
Logged In: YES 
user_id=51042

Hum... I think the documented behavior is too complex. As 
you point out, it differs from the usual Windows behavior. It 
also differs from the POSIX behavior.

I have changed the docs to reflect the actual (and simpler) 
behavior.

I've also expanded the tests in operator_test.cpp to cover all 
cases, and tied each test case to the docs via comments. All 
tests are now passing.

Thanks for the report,

--Beman
Note: See TracTickets for help on using tickets.