linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "William N. Zanatta" <william@veritel.com.br>
To: Mat Harris <mat.harris@genestate.com>
Cc: Elias Athanasopoulos <elathan@phys.uoa.gr>,
	linux-c-programming@vger.kernel.org
Subject: Re: writing logfile
Date: Tue, 25 Feb 2003 10:09:37 -0300	[thread overview]
Message-ID: <3E5B6B11.3020001@veritel.com.br> (raw)
In-Reply-To: <20030225124937.B31033@genestate.com>


   Wow it is a mess! Time to get the old book, sit down and read some 
more...

   You are opening a file through open() which returns an integer 
representation of the file descriptor and trying to write on it through 
fputs() which writes to a file descriptor represented by a FILE pointer.

   That's your answer. You are using the wrong functions.

   You may either change your code to work with integers, open(), read() 
  write() and close() or make it use FILE *, fopen(), fread() (...), 
fputs() (...) and fclose(). It is up to you and will depends on the kind 
of application you're writing.

   Each of the ways of file manipulation has advantages and/or 
disadvantages. You should seek for something about that over the net.

   ">   loghandle = open(logfile, O_CREAT);"

   Maybe I'm wrong, but I think this previous call just creates a file 
and doesn't make it available for reading/writing in any way. Is that 
right brothers???

   william

-- 
Perl combines all of the worst aspects of BASIC, C and line noise.
                 -- Keith Packard


  reply	other threads:[~2003-02-25 13:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-25 10:57 writing logfile Mat Harris
2003-02-25 11:38 ` Elias Athanasopoulos
2003-02-25 12:49   ` Mat Harris
2003-02-25 13:09     ` William N. Zanatta [this message]
2003-02-25 13:11       ` Mat Harris
2003-02-25 14:10       ` Elias Athanasopoulos
2003-02-25 14:18     ` Elias Athanasopoulos
2003-02-26  1:09     ` Glynn Clements
2003-02-26  9:25       ` Mat Harris
2003-02-26 10:09         ` Jan-Benedict Glaw
2003-02-26 10:18           ` Mat Harris
2003-02-26 19:45             ` Glynn Clements
2003-02-27 10:04               ` Mat Harris
2003-02-27 10:32                 ` SOLVED: " Mat Harris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E5B6B11.3020001@veritel.com.br \
    --to=william@veritel.com.br \
    --cc=elathan@phys.uoa.gr \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=mat.harris@genestate.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).