[Gambas-user] How to lock a file

Fabien Bodard gambas.fr at ...626...
Thu Sep 18 00:41:04 CEST 2008


# If the READ or WRITE keyword are specified, then the input-output
are not buffered.

# If the INPUT or OUTPUT keyword are specified, then the input-output
are buffered.


Maybe for that ?


2008/9/17 Almanova Sistemi <almanova at ...1228...>:
> 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.
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list