Bug 13758 – RDMD renames directory if -ofNAME is the name of a directory

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
tools
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2014-11-20T13:51:00Z
Last change time
2015-06-18T16:54:41Z
Keywords
preapproved, pull
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2014-11-20T13:51:20Z
----- ~/somedir $ mkdir foo ~/somedir $ echo asdf > foo/bar ~/somedir $ ls foo > bar ~/somedir $ echo "void main() { }" > app.d ~/somedir $ rdmd -offoo app.d ~/somedir $ ls app.d foo foo.635520880476161823-23425.old ----- The "foo.hash.old" is the old folder which was renamed to make place for the 'foo' executable. I don't think RDMD should have the power to move things around like that. It should fail compilation if the output name would overwrite the directory, with optionally providing a special switch for when you really need this behavior (I don't see the point of the feature though..).
Comment #1 by andrei — 2015-04-30T22:19:08Z
Yes please. Have it fail. Will preapprove, thanks.
Comment #2 by dlang-bugzilla — 2015-05-01T05:42:24Z
https://github.com/D-Programming-Language/tools/pull/167 (In reply to Andrej Mitrovic from comment #0) > I don't think RDMD should have the power to move things around like that. It > should fail compilation if the output name would overwrite the directory, > with optionally providing a special switch for when you really need this > behavior (I don't see the point of the feature though..). I added the renaming thing to work around Windows locking executable files that are still running. I just hadn't thought that on Posix executable don't have an extension, and writing the executable file might happen because the output file is actually a directory.
Comment #3 by github-bugzilla — 2015-06-15T21:09:20Z
Commits pushed to master at https://github.com/D-Programming-Language/tools https://github.com/D-Programming-Language/tools/commit/7b655a13ce020232b625fabaaea5918fad18fcc2 fix Issue 13758 - RDMD renames directory if -ofNAME is the name of a directory https://github.com/D-Programming-Language/tools/commit/55e5dc6312edbf947cbd775ad34cd25104184c2a Merge pull request #167 from CyberShadow/pull-20150501-053027-13758 fix Issue 13758 - RDMD renames directory if -ofNAME is the name of a dir...
Comment #4 by github-bugzilla — 2015-06-18T16:54:41Z
Commits pushed to stable at https://github.com/D-Programming-Language/tools https://github.com/D-Programming-Language/tools/commit/7b655a13ce020232b625fabaaea5918fad18fcc2 fix Issue 13758 - RDMD renames directory if -ofNAME is the name of a directory https://github.com/D-Programming-Language/tools/commit/55e5dc6312edbf947cbd775ad34cd25104184c2a Merge pull request #167 from CyberShadow/pull-20150501-053027-13758