mahusa7
November 8, 2017, 12:12am
1
I am copying a file to temp from package, and want to write to it. However, the permissions of the file turn out read only. Is there a way to change the permissions?
print fileSystem.Stat(“tmp:/Untitled.m3u8”) gives:
<Component: roAssociativeArray> =
{
ctime: <Component: roDateTime>
hidden: false
mtime: <Component: roDateTime>
permissions: “r”
size: 858
type: “file”
}
Any suggestions or workarounds would be appreciated.
did you try setting the permissions on the file to 777 before you deploy the app?
I did. It seems that any file read from package becomes read only. I found a workaround for this by downloading the file to tmp from a server.
NB
November 9, 2017, 5:42pm
4
Said m3u8 is a small text file, right?
ReadAsciiFile()/WriteAsciiFile()
WriteAsciiFile does not work as the file is read only when read from pkg.
NB
November 11, 2017, 1:04am
6
“mahusa7” wrote:
WriteAsciiFile does not work as the file is read only when read from pkg.
And if you try this?
text_content = ReadAsciiFile("pkg:/my.m3u8")
' massage text_content to your heart`s content here
' ...
WriteAsciiFile("tmp:/my.m3u8", text_content)
destruk
November 13, 2017, 1:06am
7
That should work RokuNB, as it’s writing it to tmp
mahusa7
November 13, 2017, 3:29pm
8
That does work. Thank you.