not.hDuplicate

Bulat Ziganshin bulatz at HotPOP.com
Sat May 14 05:28:27 EDT 2005


Hello glasgow-haskell-users,

  my program contaions several forkOSed threads and at one moment one
  thread gives to another handle of open file. i need to read some
  data from this file. how can i accomplish this? if i use hDuplicate,
  then both handles will share the same file pointer, so threads will
  mess each other. are there some way to duplicate handle with
  creating separate file pointer, or to get filename from the Handle,
  or (preferable) to block another thread's on attempt to access the
  same handle until i done with it and return to old file pointer?

-- 
Best regards,
 Bulat                          mailto:bulatz at HotPOP.com





More information about the Glasgow-haskell-users mailing list