in reply to Re^4: true from (-e "") on Windoze (" is an illegal filename character
in thread true from (-e "") on Windoze
I don't know what combination of compiler and OS you use
MS compiler; Vista 64-bit.
but on my system (Win7 Ult + Strawberry 5.14.2 x64),
What do you expect the gcc CRT to emulate?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: true from (-e "") on Windoze (" is an illegal filename character
by afoken (Chancellor) on Jul 05, 2012 at 20:13 UTC | |
What do you expect the gcc CRT to emulate? Nothing. stat (via _stat64) is available from msvcrt.dll, as documented by Microsoft. For the return value, MS writes: Each of these functions returns 0 if the file-status information is obtained. A return value of –1 indicates an error, in which case errno is set to ENOENT, indicating that the filename or path could not be found. A return value of EINVAL indicates an invalid parameter; errno is also set to EINVAL in this case. So, let's have a look at errno:
Output:
I think this is what one should expect. The file "" does not exist, and NULL is an invalid parameter. For the current directory and the exe file, stat() returns 0, as expected, and errno is not touched at all, so it stays 2 from the previously failed stat(). Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-) | [reply] [d/l] [select] |
by BrowserUk (Patriarch) on Jul 05, 2012 at 20:39 UTC | |
I think ... Sorry. But you are still wrong. Trying to draw conclusions about what the MS compiler does, from what you can observe from compiling similar code using the Mingw; is like trying to draw conclusions about the AC Cobra from driving a DAX 427 kit car. Observe:
That code, compiled with an MS compiler, doesn't import anything from msvcrt.dll! I'll let you work out why for yourself. With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |