[Gambas-user] How to lock a file

Almanova Sistemi almanova at ...1228...
Wed Sep 17 23:31:31 CEST 2008


Hi,

is the first time that I write to list, but i have a problem.

I am writing an application in gambas (2.7.0-2.1) on opensuse 10.3 -
11.0 and I need to lock a file when I open it.

My code:

...
hfile = OPEN "/usr/far/alman/NOMEFARM.DAT" FOR INPUT OUTPUT
TRY LOCK hfile
IF ERROR then
    ...
ENDIF
LINE INPUT #hfile, MyVar
UNLOCK hfile
CLOSE #hfile
...

When I execute it I get the following messge:
Useless LOCK in line ...

Why ?

Regards,
Massimo.



More information about the User mailing list