Re: File exist
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Sun, 16 Apr 2006 19:38:41 GMT
ed <ed@xxxxxxxxxxx> writes:
On 16 Apr 2006 01:53:03 -0700
paytam@xxxxxxxxx wrote:
Can anyone tell me how can I check that a file exist or no.
[...]
Try using stat(5).
There is no stat() function in standard C. Using it will limit the
portability of your code. See comp.unix.programmer.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <
http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <
http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
Relevant Pages
- Re: Is stat function thread safe ?
... response. ... stat is not a standard C function. ... Keith Thompson kst-u@xxxxxxx ... (comp.lang.c) - Re: Initializing constants
... Keith Thompson wrote: ... Long doubles just do not have the same portability yet. ... Long double has been in the C standard since 1989. ... (comp.lang.c) - Re: How to detect an empty file?
... The stat() function is not part of the standard C library. ... The loss of portability may or may not be an ... acceptable price to pay for the convenience of using the stat ... (comp.lang.c) - Re: Need help on modifying and assembly of a small program!
... care for "international support" at the moment...BUT will you care _LATER_? ... make your keyboard driver use "keymaps" or something (which simply ... that there's a kind of "standard" for typing English with their Cyrillic ... This is the "portability" of the OS source ... (alt.lang.asm) - Re: removing a loop cause it to go at half the speed?
... The concepts are also useful because they are well defined by the same standard that defined the C language. ... If the standard says it is undefined behaviour then even if your implementation defines it you know that you will have to check whether it is documented for *every* system you want to use it on in the future, and you may well come across a system which leaves it completely undefined and possibly even causes random behaviour. ... or you will have on some other platform. ... Portability is not always easy or possible, but the starting point is knowing what the C standard guarantees and what it doesn't. ... (comp.lang.c) |
|