write a log file

This is a discussion on write a log file within the Networking/Device Communication forums, part of the General Programming Boards category; I do not even know where to start. How do I create a log file where after executing some client-server ...

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    99

    write a log file

    I do not even know where to start. How do I create a log file where after executing some client-server communication user can read what kind of info exchange was performed. I'm writing this in C.
    Any introductory comments where to look for info???
    Thanks.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    fopen()

    http://www.cplusplus.com/

    Check out my website for software development links.

    http://www.dslextreme.com/users/kuphryn/links.html

    Kuphryn

  3. #3
    Registered User
    Join Date
    Sep 2004
    Posts
    99
    That's not what I meant. Thanks anyway.
    I have no problems with files manipulation in C. My question is what I need to write to a log file of that type and if fprintf is what I'm looking for. The client does not do much. Just sends some info entered by user and waits for servers response and data.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,558
    Which OS?

    Linux has for example a specific API for creating log files.

    Yes, you can just use fprintf() if you want to.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    99
    Thanks Salem. Client is on Red Hat 7.2, but server is on SunOS 5.10 if I remember correctly the version number. Would it make a difference?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  2. SYnchronize read & write of a cache file
    By lei_michelle in forum C Programming
    Replies: 4
    Last Post: 02-26-2008, 04:49 PM
  3. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21