-
-
Notifications
You must be signed in to change notification settings - Fork 743
Std.stdio.file fixes #778
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
Std.stdio.file fixes #778
Conversation
denis-sh
commented
Sep 8, 2012
- Refactor std.stdio.File
- Fix Issue 7659 - std.stdio.File.close() erases file.name
- Fix std.stdio.File part of Issue 4624
|
By the way, you may want to add yourself to the authors list. |
"If" and 2x"that the" are fixed. |
Can't find that comment... what line? |
Sorry, something went awry with that comment. I was asking why the assert in the |
And it looks like it was 2 "if" comments but I have seen only one...
Just for tracking possible bugs in P.S.Damn Github doesn't show any of your old comments now and doesn't send line numbers in email notifications! |
Yeah, I thought the first one got lost, so I commented again. But it's OK, you've fixed all the issues I pointed out.
So I presume that people using the |
No they don't. The problem is in absence unified way to mark:
|
LGTM then. |
Sorry, one more commit. ) |
Looks OK too. |
Added 2 more commits to make |
|
It will. Just like any other incorrect behavior bugfix it will break the code relying on that. I just hope there is no (little) such code because personally I can't imagine me writing code that rely on undocumented |
Why is this failing? |
You mean autotester, yes? As you see test dmd fails because runnable/statictor.d postscript sees empty output instead of this 8 lines... Sorry, I have no idea (except another dmd bug) too. Will try to dig into. |
OK. 5cf41e8d1e25ca639fd1376a941c906412b67bc5 breaks the code relying on @braddr, is it a bug or do you really rely on this? |
OK. It's clearly a bug. The test will fail once flush will be here at line 406 because postscript doesn't expect |
(I meant possibility of random failures) |
Will try to fix this in dmd pull 1124. |
Fixed. Have to wait for revising/merging dmd pull 1124. |
} | ||
private Impl * p; | ||
private Impl* p; | ||
private string m_name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't use the m_
convention anywhere. Either use name
or use _name
. In the latter case you'll need to also change p
with _p
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why migrating the name outside of Impl
?
Some refactorings eliminating old bug workarounds are great (e.g. write*, various opens). I have a few nits with others as noted. |
* also improve documentation a bit
To @andralex (rebased with the fallowing cosmetic fixes):
Renamed
Distinguishing removed. It was incorporated because of @alexrp comment:
Alignment fixed. |
A copy of |
How interesting. Does it mean that it was intentional for And I'd like to see your explanation why it was added. Because it is undocumented, useless (see my opinion in commit description), inconsistent with IO in other languages, and even inconsistent with |
There is absolutely no need to explicitly flush a stream on new line because it is expected only for console output which is line buffered or unbuffered by default.
* don't throw AssertError in writef * make these functions consistent with std.format.formattedWrite
First of all, let's not forget (a) nobody is after you; (b) to the extent we're less competent than you think you are, it's not our fault; (c) we're all in this together as we want to do good things and move the state of the art forward. The intent behind adding flush to Anyhow, it seems this strategy is too obscure, so I'm fine with removing the flush. I'll make one more pass now through the latest. Keep in mind - we're on the same boat and we want to do Good Things(tm). Thanks. |
merged |