[Gambas-user] Open File for Watch Read Past EOF

Gianluigi bagonergi at ...626...
Tue Jan 10 12:04:40 CET 2017


Hello Jeff,
Your mail is seen as spam, raise it with this answer.
"Test" what kind of file it is?

Regards
Gianluigi

2017-01-09 14:35 GMT+01:00 Jeff Zacher <ad_sicks at ...43...>:

> I am using Gambas 3.9.1
>
> If I open a file for watch:
>
> hFile = Open "test" For Read Write Watch
>
> The _Read() event gets the first byte written to the file just fine. But
> after, no changes to the file fire the read event. So as a workaround,
> just close the file and reopen? On second read the _Read() event in
> fired immediately and continues to fire past the eof until the file is
> again closed.
>
> Code to reproduce. Form with two buttons:
>
>
>  Gambas class file
>
> Private hFile As File
>
> Public Sub File_Read()
>
>   Dim iByte As Byte
>   If Not Eof(hfile) Then
>         Read #hFile, iByte
>         Print "Got one byte: "; iByte
>   Else
>         Print Time()
>   End If
> End
>
> Public Sub Button1_Click()
>
>    Close hFile
>
> End
>
> Public Sub Button2_Click()
>
>   hFile = Open "test" For Read Watch
>
> End
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> 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