wilzbach / tools-test

1 stars 0 forks source link

RDMD renames directory if -ofNAME is the name of a directory #118

Closed wilzbach closed 9 years ago

wilzbach commented 9 years ago

Note: the issue was created automatically migrated from https://issues.dlang.org

Original bug ID: BZ#13758 From: Andrej Mitrovic <andrej.mitrovich@gmail.com> Reported version: D2 CC: @andralex, dlang-bugzilla@thecybershadow.net

wilzbach commented 9 years ago

Comment author: Andrej Mitrovic <andrej.mitrovich@gmail.com>


~/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..).

wilzbach commented 9 years ago

Comment author: @andralex

Yes please. Have it fail. Will preapprove, thanks.

wilzbach commented 9 years ago

Comment author: Vladimir Panteleev <dlang-bugzilla@thecybershadow.net>

https://github.com/D-Programming-Language/tools/pull/167

(In reply to Andrej Mitrovic from comment BZ#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.

wilzbach commented 9 years ago

Comment author: github-bugzilla@puremagic.com

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 BZ#167 from CyberShadow/pull-20150501-053027-13758

fix Issue 13758 - RDMD renames directory if -ofNAME is the name of a dir...

wilzbach commented 9 years ago

Comment author: github-bugzilla@puremagic.com

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 BZ#167 from CyberShadow/pull-20150501-053027-13758