[Gambas-bugtracker] Bug #1696: Write of a string[] to a MEMORY FILE only save or reads first element, lof() always returns zero on memory file

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Mon Dec 16 19:59:29 CET 2019


http://gambaswiki.org/bugtracker/edit?object=BUG.1696&from=L21haW4-

Comment #8 by Brian G:

I will download and build to confirm.

I understand how to serialize to memory memory, I am doing that. The issue is that I need to know how much shared memory to allocate before i serialize to it.

So am really unable to do as you suggested. that is why adding a serialize keyword to the open memory or memory that causes no real output only the count of byte to write. would be useful as I could do seek(mFile) and get size of memory to allocate and then do the real write to memory for example.

mypointer = null 
Mfile = MEMORY #mypointer for serialize
write #mFile, "asdasdasdsadsad" as string
mLength = seek(mFile)
close mFile

mypointer = mmap(null,mLength,0,1)
mFile = MEMORY #mypointer for write
write "asdasdasdsadsad" as string
close mFile

Would adding that key word be possible?

Brian G changed the state of the bug to: Accepted.




More information about the Bugtracker mailing list