[Gambas-user] Changes in LINK

Benoit Minisini gambas at ...1...
Sat Oct 28 22:10:50 CEST 2006


On Saturday 28 October 2006 21:59, Rob wrote:
> On Saturday 28 October 2006 15:41, Christopher Brian Jack wrote:
> > Another alternative could be to take out LINK completely and
> > make Link a File method (I can just hear the boos and hisses
> > now)?
>
> I really think if it were a File method, it should be static.
>
> I've actually always wondered why LINK, RENAME/MOVE, etc. were
> built-in keywords and not part of the File class anyway.... I
> assume it was to make VB people more comfortable, but all these
> keywords are different than the VB ones.
>

Hey, it is the BASIC way. :-)

> > Where the OPEN fails if it can't get a file lock immediately
> > after opening when LOCKED is specified.  The idea being to
> > allow serialized/atomic file access sections (of course CLOSE
> > would then have to be aware of locking and drop the lock after
> > committing buffers but prior to making the close system call).
>
> It will eventually be important to have file locking in Gambas.
> Right now I think the only way to do it is with API calls, if
> it's possible at all....
>
> Rob
>

You have the LOCK and UNLOCK keyword for locking/unlocking a file opened for 
writing.

Maybe I should rewrite them so that they work on a path and not on a file. 
This will be easier to use: you choose a path file that will work as a lock, 
and you use LOCK and UNLOCK on it.

-- 
Benoit Minisini





More information about the User mailing list