Przemyslaw,
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.
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.
Best regards.
Maurilio.
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.
Przemyslaw Czerpak wrote:
> On Tue, 08 Jul 2008, David Arturo Macias Corona wrote:
>
> Hi David,
>
>> Harbour under OS/2 does not output to printer
>> Notice: I never tried to print with Harbour under OS/2 due I use it in
>> server side, which does not need to print, so this was a surprise
>
> Have you tried xHarbour?
> Such printing uses normal file API. In xHarbour Maurilio changed open()
> function used by hb_fsOpen() to OS2 API DosOpen() combined with _imphandle()
>
> 2006-06-06 09:58 UTC+0200 Maurilio Longo <[EMAIL PROTECTED]>
> * source/rtl/filesys.c
> + added HB_OS2_IO sections to work around a GCC 'feature' on OS/2
> which makes it fail to open/create files on filesystems which do
> not support extended attributes (EAs).
>
> It's possible that this modification resolves the problem.
> Anyhow if possible I would like to also ask you to make tests
> with file range locking with Harbour and xHarbour. F.e. try
> to check if RLOCK set by one process is visible by other, f.e.
> in this code:
>
> proc main()
> if !dbExists("_tst")
> ? "Create table"
> dbCreate("_tst",{{"F1","C",1,0}})
> use _tst
> dbappend()
> close
> endif
> use _tst shared
> dbgoto(1)
> ? "Locking record 1:", dbRlock()
> inkey(0)
> return
>
> I'm not OS2 user/programmer and it's not clear for me reading OS2
> API if it is possible to set file range locking without HLockID handler
> returned by DosProtectOpen(). If _imphandle() cannot retrieve it
> internally from OS structures then probably not.
> If locking works correctly in xHarbour then I'll add Maurilio's
> modifications to Harbour OS2/GCC builds.
>
> best regards,
> Przemek
> _______________________________________________
> Harbour mailing list
> [email protected]
> http://lists.harbour-project.org/mailman/listinfo/harbour
>
--
__________
| | | |__| Maurilio Longo
|_|_|_|____| farmaconsult s.r.l.
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour