mahusa7
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2017
04:12 PM
Changing permissions of file in temp
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.
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.
7 REPLIES 7
tim_beynart
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2017
07:49 AM
Re: Changing permissions of file in temp
did you try setting the permissions on the file to 777 before you deploy the app?
mahusa7
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2017
08:12 AM
Re: Changing permissions of file in temp
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_
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2017
09:42 AM
Re: Changing permissions of file in temp
Said m3u8 is a small text file, right?
ReadAsciiFile()/WriteAsciiFile()
ReadAsciiFile()/WriteAsciiFile()
mahusa7
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2017
10:38 AM
Re: Changing permissions of file in temp
WriteAsciiFile does not work as the file is read only when read from pkg.
NB_
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2017
05:04 PM
Re: Changing permissions of file in temp
"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
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2017
05:06 PM
Re: Changing permissions of file in temp
That should work RokuNB, as it's writing it to tmp 🙂
mahusa7
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2017
07:29 AM
Re: Changing permissions of file in temp
That does work. Thank you. 🙂