problem setvbuf

This is a discussion on problem setvbuf within the C Programming forums, part of the General Programming Boards category; Dear experts, please help me, i am working on maintenence project, in that they have used setvbuf, but it is ...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    99

    problem setvbuf

    Dear experts,

    please help me,

    i am working on maintenence project, in that they have used setvbuf, but it is showing very strange before in unix and windows,
    in case of unix with _IOLBF option once it is opened and set with buffer size with setvbuf and the contents are written to the file once the maximum size reaches it flushes the buffer and starts from begining, so there is no memory problem.

    but in windows once it reaches the maximum size of buffer it will not starts from begining,
    may be for win32 there is no diffrence from _IOFBF and _IOLBF ,
    but in depth can you tell me the difference b/w _IOFBF and _IOLBF because in net i have seen only definitions for these.

    my question is what is the reason for this behavior if i want to replace the this function with some general or simple functions how to do,

    what is the replacement of setvbuf,
    please inform. thanks in advance.

  2. #2
    Registered User
    Join Date
    Jul 2009
    Posts
    51
    For Win32 systems _IOLBF has the same functionality as _IOFBF.

    I don't really understand your question in regards to the odd behavior in Windows, perhaps you could rephrase it?

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    99
    I think my question is confusing,

    my main question is what is the main neccessity of using setvbuf even though i have read so many definitions in web but practiacally what is the use and what is the difference between _IOLBF and _IOFBF options for servbuf with some example,

    because in windows as i read it is _IOFBF only works.

    because of this setvbuf is confusing is there any system call which i can replace the setvbuf please explain.

    thanks in advance.
    Last edited by vin_pll; 08-11-2009 at 04:25 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 10:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. Problem about setvbuf()
    By albert3721 in forum C Programming
    Replies: 8
    Last Post: 05-17-2007, 10:02 AM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM

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