On Tue, 08 Jul 2008, Maurilio Longo wrote:

Hi Maurilio,

> Locking works ok on xHarbour, I'm using it extensively on files shared between
>   OS/2, DOS and win32 processes which handle files on a mars_nwe volume.

This may work because it uses different internal API. The client requests
are translated to NetWare protocol and send to mars. BTW I still haven't
public 63 bit POSIX locking patches for mars so you should not use CL53
or HB64 locks in such installations.

> I think that my fix to filesys.c is superceded by newer GCC versions, but I
> did not test this extensively given that the present code seems to work OK.

What GCC version you are talking about?
David's report suggests that code like:

   proc main()
      local hFile, cFile, cData
      cFile := "PRN"
      cData := "Printer test" + hb_osNewLine() + ;
               Version() + hb_osNewLine() + ;
               Os() + hb_osNewLine() + ;
               DTOC( Date() ) + " " + Time() + hb_osNewLine() + ;
               Chr( 12 )
      if ( hFile := fopen( cFile, 2 ) ) != -1
         ? "Writting to", cFile
         ? "Bytes written:", fwrite( hFile, cData, len( cData ) ), ;
           "from:", len( cData )
         fclose( hFile )
      else
         ? "Cannot open:", cFile
      endif
   return

does not work.

Does it work for you for printers connected to local computers?

> BTW, You don't need to call DosProtectOpen() to make a lock, a DosOpen()ed
> file can be locked as well, see xharbour filesys.c line 2496 for example.

Thank you very much. I missed it. I guess that it will work also for
local filesystems between processes.

best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to