Re: read and write



On May 31, 12:49 am, Flash Gordon <s...@xxxxxxxxxxxxxxxxxx> wrote:
Darko wrote, On 30/05/07 16:51:



On May 30, 6:24 am, Clark Cox <clarkc...@xxxxxxxxx> wrote:
On 2007-05-29 17:12:02 -0700, Darko <darko.maksimo...@xxxxxxxxx> said:

On May 29, 10:52 pm, CBFalconer <cbfalco...@xxxxxxxxx> wrote:
asit dhal wrote:
can anyone explain me how to use read() write() function in C.
and also how to read a file from disk and show it on the monitor
using onlu read(), write() function ??????
There is no read nor write function in C. Look up such things as
fopen, fclose, fread, fwrite.
--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
<http://kadaitcha.cx/vista/dogsbreakfast/index.html>
cbfalconer at maineline dot net
--
Posted via a free Usenet account fromhttp://www.teranews.com
Let be honest, then, there are no functions fopen, fclose, fread,
fwrite neither in C.
Umm, the C standard says otherwise.

--
Clark S. Cox III
clarkc...@xxxxxxxxx

Pleas do not quote peoples signatures unless you are commenting on them.

I am sorry to have disturbed emotions of so many people here, I did
not intend to do that. Luckily, my employer is not so tough and strict
as some of you folks are, so I think I won't get fired soon. Maybe
later.

You have probably reduced the number of potential future employers by a
few. There is more than one person here involved in recruitment for
their companies.

As Keith Thompson noticed, the ISO 9899 C standard also lists
functions in the Library section, but I wouldn't dare calling it a
"minor quibble". Since, if one took to read the whole standard or at
least to look at it in detail, would see some key sentences when the
author(s) clearly distinguished the Language and the Library.

Yes, but the standards do not say that one is C and the other is not.

Furthermore, besides the Standard Library, there are other things that
this document talks about, which are also not a part of the language.
Quote:

"This International Standard is divided into four major subdivisions:
preliminary elements (clauses 1 4);
the characteristics of environments that translate and execute C
programs (clause 5);
the language syntax, constraints, and semantics (clause 6);
the library facilities (clause 7)." ("Introduction", page xiv)

You started reading to late. In C99, just before section 1, at the top
of page 1, it says in bold large type, "Programming languages - C" thus
indicating that the entire document is talking about C.



Would we be so courageous to call "The characteristics of environments
that translate and execute C programs" also a part of C? I will let
you answer this question, since I don't want to risk more yelling and
offending. Perhaps you have a different answer because it is mentioned
and talked about "in the standard".

Quote:
"....added to this International Standard. Subclauses in the
__language__ and __library__ clauses warn
implementors and programmers of usages which, though valid in
themselves, may con ict with future additions."
".....or new programs (for language [6.11] or library features [7.26])
is discouraged." ("Introduction, page xiv)

These quotes also clearly distinguish the language from the library.
It seems that it all comes down to the question what "C" is - the
library, the library and the language, or the language. If it's the
point of opinion, then I say it's the language.

Most people seem to disagree with you.

> I probably think so

because of all the language structures such as "the C programming
language" and categories "Programming languages" when we always see C
among others etc. It is also, in my opinion, somewhat absurd that all
of these libraries are part of "C", whatever it is, since they contain
many things that exist now but will not later, because of all the
technology advances. Even this ISO 9899 standard says the similar
thing:
"With the introduction of new devices and extended character sets, new
features may be
added to this International Standard." ("Introduction", page xiv)

That is saying things may be added to C, not that anything you can
currently call from C is C. It also contradicts what you C does not
include the standard C library.

So, the standard is extensible, because it contains libraries aside
from the language itself. Let's make an example - can some of the
following headers (mentioned in the document, as part of the standard
library) be considered a part of "C":
<signal.h> <setjmp.h>

Do all architectures even have these features, or if they do, do all
the operating systems have these features?

Shows how little you have read.

> I think not, so I also

think they can't be part of "Standard C", although they maybe can be
mentioned in the "Standard Library", since one doesn't really have to
have the complete standard library in order to program in C.

However, any hosted implementation is required to include the entire
standard C library, and prior to the standard the first edition of K&R
says "Chapter 7 describes the standard C I/O library, which provides a
common interface to the operating system. This I/O library is supported
on all machines that support C...
^^^

So prior to the ANSI standard, to be considered a C implementation it
had to have fopen etc. according to the nearest thing the language had
to a definition.

I am sorry again to have annoyed you, I know I'm offending your sense
of being the smartest and the completest programmers, but there is

You have done nothing to indicate you are smarter or better, so I doubt
that anyone thinks that.



such thing as fair and civilised argument that's not supposed to have
words "crap" in it and rude behaviour.

Regards,

Darko

P.S. Considering the comments about drivers, I admit my knowledge
doesn't reach that much; I was trying to help as long as we are
talking about systems that are most likely to have any connection with
someone who doesn't know how to use read() and write(), thus not
taking into account systems that don't have drivers or don't have read/
write/open/close functions in their interfaces. I agree there are such
systems, but I have never had a chance to get in touch with them, but
most probably are also totally irrelevant for this topic, since asit
dhal asked about exactly these functions. When I directed him to
comp.unix.programmer, I didn't imply only Unix has this interface, but
I thought folks from this group are most likely to help him, and it is
justified to ask the question there.

Unless he is using the Windows versions of those functions which are
part of a subtly different interface and on Windows are not the low
level functions they are on Unix. In any case, people were not
complaining about you suggesting asking on comp.unix.programmer, they
were complaining about you saying C does not have functions that the
standard and all versions of K&R say it does have.

So, instead of saying "sod off" to all of you, which I should, I will
just let you be what you are. Have a nice day.

You can't stop us being what we are and you are unlikely to
significantly impact on the quality of anyone's day here.
--
Flash Gordon

OK, I would just like to sum up for some people here that noone really
thought that there are no functions printf/scanf/... in C, if the term
includes the standard library as well. What I thought when I said "C"
was C language, not C as in "C language and standard C library", and I
still stand behind the fact that there is no printf in the C language.
As for "clueless", "fired", "plain crap", massive sarcasm etc. the
"sod off" but the disingenuousness too are still on ;-)

.



Relevant Pages

  • Re: Languages with well-integrated Foreign Function Interface to learn from?
    ... for scripting language FFIs. ... it seems that this interface wouldn't ... and that the standard libraries could not be ... same types of metadata which is often available only to the compiler (AKA: ...
    (comp.compilers)
  • Re: [LONG] Re: Why code completion and early error checking are needed
    ... >> the programmer who wants such features. ... > libraries to find the type declaration. ... If you type std::vector that means the one from the Standard. ... > of the language to have certain naming and declaration standards ...
    (comp.lang.cpp)
  • Re: Qi Seems Great
    ... Common Lisp will simply trounce anything else in the long ... but having third party libraries to support the new ... ideas come along doesn't mean that the language itself will grow. ... Having in mind that the CL standard is rather old, ...
    (comp.lang.lisp)
  • Re: Forth and Unix -- history
    ... but modern Forths mostly drive them away. ... You have no justification to call STOIC retro nostalgia given that Standard Forth is pretty much stuck in the mid 70's. ... Users provide a large fraction of those libraries for C. Publicly. ... users must find the language comfortable in order to create such things. ...
    (comp.lang.forth)
  • Re: Why code completion and early error checking are needed
    ... > it does not need a seperate interface to the standard libraries. ... implementation to provide this interface than to have the user do so. ... "There is only One inviolable Law" ...
    (comp.lang.cpp)