Re: g_io_channel_add_watch



Thanks alot; I needed a laugh.

        I have the luxury of coding in a Linux;
embedded environment and never had to _or_ bothered
to deal with Win32. Every time I hear stuff like
that my disinterest in Win. increases. Just glad
its not my job.

Good luck,

Tristan

Harring Figueiredo wrote:

 Tristan,

 You are just repeating my question !!! LOL -- this was exactly what I said
when
I first tried to work with the proprietary, close source/info, software.--- I
asked their company?

 Did you guys know that there is something called socket and that would make
your app network transparent ?

  Answer: Oh, it is esasier for our users to access the protocol through a flat
file.

   I said: "Well, now every user running on a dist. environment needs to set a
socket server of their own on a machine just to do what your software could do
in the first place -- Now we have to write a server, a file locking mechanism
that on windows correctly ( We initially used JAVA to write to this file, but
stupid, brain dead JAVA did not have file locking -- and now it does not work
properly on 1.4 -- end side note). { try : file.getChannel.lcok(), and you will
get a ugly exception!!).

  Are you sure you guys still think that it would be easier ??

  Then I said -- people make stupid mistakes -- they just have a tough time
admitting it.

  Sorry for being so humble :P)

 Is that funny or what ? ( I hope you had a good laugh :P)

Harring.


--- Tristan Van Berkom <vantr touchtunes com> wrote:

I _really_ don't get it. why do
Inter Process Communication with a
regular file !?

why not a network protocoll ?

man connect(), recv(), socket(),
      accept(), bind() ...

you must have some of this stuff in
a Win environment.


    -Tristan

Harring Figueiredo wrote:

 Thanks for the reply --

 I need to communicate with a proprietary software through this file --
 Locking is done on both sides -- I guess I am going to do the "smartest"
pulling there is:)

   while(file locked)
   {
       sleep(1);
       if(tries > 10 ) break; /* could not open the file for now -- come
back
later. */
    }

 I can't think of any alternatives --

Harring

--- Tristan Van Berkom <vantr touchtunes com> wrote:
      An IO channel needs an open file descritpor.
How do you manage that in windows ? I assume you need to
use a socket instead of a named pipe. (I'm guessing
you need a simple IPC). I'm absolutly clueless in
the Win environmentbut I know that g_io_channel_add_watch
needs to have an open file descriptor if its ever going
to perform select() poll() or whatever it does.

Good luck!
      -Tristan


Harring Figueiredo wrote:

Folks,

 I am writting an app on Linux to run on Win.

 On Win, once we open a file, it is locked, so other proc are
automatically
blocked from  opening that file.

  I want to add a watch (g_io_chanel_add_watch) to a regular file on
windows.
Will this cause the file to remain open while the watch is active ? Can
the
other process(es) still open the file?

 Anyone with experience on that ?

 Thanks.

 I have not tested, because I still don;t have the Win machine...
Thanks !!

Harring.




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