Re: gdk_input_add



On Sun, Feb 24, 2002 at 06:20:05AM -0800, David Larsson wrote:
Hi.

I'm having some trouble to check whether a file is updated or not.

I want to use gdk_input_add() to check if a file-pointer (FILE *fp) is changing. I dosn't seem to make it 
work. Is there someone who has 
any help for me? :)

//David
---end quoted text---
Hi,

Since gdk_input_add do not work with FILE *, GIOChannel *, but instead, only a file descriptor, you have to 
do this:

void filechangefunction(gpointer data, gint fd, GdkInputCondition condition)
{
  FILE *fp = (FILE *) data;

  ...
}

gdk_input_add (fileno(fp), GDK_INPUT_READ, filechangefunction, fp);

[]'s
-- 
Marcelo R Leitner <mrl netbank com br>
ICQ #: 29966851



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]