New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mkdir($file) succeeds if $file exists and is a regular file #5193
Comments
From @hoelzroTo reproduce: $ touch /tmp/my-fake-directory I understand that we want to succeed in the common case that that directory already exists, but I'm wondering if that's the correct behavior and whether we should leave handling that case up to the user. |
From @lizmat
FWIW, I think this is really a problem in the lower level nqp::mkdir() always returning True. |
The RT System itself - Status changed from 'new' to 'open' |
From 1parrota@gmail.comIf a name's already in use, what's the right response to an attempt to On 3/23/16, Elizabeth Mattijsen <liz@dijkmat.nl> wrote:
|
From @hoelzroOn 2016-03-23 09:20:42, 1parrota@gmail.com wrote:
Personally, I think we should propagate this error to the user and let them handle it.
Let's say I have a regular file, "output.log", which has a lot of useful information, and I try to mkdir("output.log"). If it blows away the file in order to make output.log into a directory, I would consider that seriously LTA. While I think that trying to be convenient to the user is a good thing, I think offering too much convenience to the user can do more harm than help.
|
From ngaywood@gmail.comI'd like to see the same behavior that occurs in perl5. That is: DB<3> mkdir "existingfile" or warn "$!\n" DB<7> mkdir "newdir" or warn "$!\n" |
Some more discussion about |
I also think that It doesn't do this on current MoarVM:
On the JVM backend
|
I believe this has been fixed by now:
Fix for MoarVM: MoarVM/MoarVM#1507 (with two follow ups: MoarVM/MoarVM@6ef4dd3cb1 and MoarVM/MoarVM#1727). Tests have been added to Rakudo (rakudo/rakudo#4408) and Roast (Raku/roast#736). So I think it is fine to close this issue as resolved. |
Migrated from rt.perl.org#127772 (status was 'open')
Searchable as RT127772$
The text was updated successfully, but these errors were encountered: