FileStream with HTML5 not working?

Kelevra

New Member
Joined
Mar 24, 2019
Hi all.

I have a bug that might just be local to me as it doesn't seem like anyone else on the forum has been having the same issue.

Basically, I'm having trouble with the FilesStream command when used in the 'Html5 game' in both release and debug. When I go to compile and run, it doesn't even get as far as the browser but opens up the filestream.cxs source file and points to about line 12 which says that "Native FileStream class not implemented." (it seems ok when running on the windows build etc).

I had a look at the LANG variable which governs the error and this is set to .js, so it is looking for the FileStream.js file in \Cerberus\modules\brl\native. Needless to say, the cpp, java, cs versions are there but no js version. Is this right? I did a quick google for FileStream.js and chucked in the first thing that came up, but it didn't work (no surprises but I had to try).

Am I missing something from the cerberus build/zip file? I've re-installed it with the latest but it's still not working for me. Anyone have any ideas?

Thanks for your time.

Cerberus X:
Import mojo
Import brl.filestream

Class Game Extends App

    Method OnCreate()
        Print "OnCreate"
        Local myFile:FileStream = FileStream.Open("cerberus://internal/world.dat", "r")
        SetUpdateRate(30)
    End

    Method OnUpdate()
        Print "OnUpdate"
    End

    Method OnRender()
        Print "OnRender"
        Cls 0,0,0
    End

End

Function Main()

    New Game()

End
 

SLotman

Member
Joined
Jul 3, 2017
Filestream is not implemented in HTML5. It never was, since Monkey-X days.

And it probably never will, since Filestream is binary read/write access to local files and that is a big NO-NO on HTML. Security issues and all that.

On HTML5 you can only use LoadString and SaveString, which AFAIK uses cookies.
 
Top Bottom