Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
johnmarsden
Visitor

Could a user's registry be non-writeable?

Is there any chance that a user's registry may be no writeable for some reason.. whether it be storage restraints or something of the kind? My assumption was that each app installed as a certain amount of allocated/guaranteed registry storage, but I'm not sure.

I'm getting some reports from customers that certain settings aren't saving for them... but they're saving correctly on all my devices. My only guess is that it could be something related to registry. 
0 Kudos
2 REPLIES 2
EnTerr
Roku Guru

Re: Could a user's registry be non-writeable?

It surely is possible - and the case i have in mind is when you have stored too much info in the registry, then flushing to disk fails. You should check on the return of .flush() - notice how most functions return Boolean
0 Kudos
Komag
Roku Guru

Re: Could a user's registry be non-writeable?

I use this to count my registry size
FUNCTION getRegSize(report AS BOOLEAN) AS INTEGER ' trig by saveAll(1) report False, and for testing from console where report may be True
sz = 30 ' Header for the whole registry
r = CreateObject("roRegistry")
secList = r.GetSectionList()
FOR EACH name IN secList
secSz = 8 ' A small header for each registry section (2 bytes plus section name, assume 6 more bytes)
sec = CreateObject("roRegistrySection", name)
keyList = sec.GetKeyList()
FOR EACH key IN keyList
val = sec.Read(key)
secSz = secSz + Len(val) + 4 ' Headers - add 2 bytes for the key and 2 bytes for the value
END FOR
IF report THEN ? "getRegSize() sec name " name ", secSz" secSz
sz = sz + secSz ' Add this section's secSz to the overall sz
END FOR
IF report THEN ? "getRegSize() overall sz" sz
RETURN sz
END FUNCTION
0 Kudos