Your Digital Media Has Never Looked So Good

 
mahusa7
Topic Author
Posts: 14
Joined: Mon Oct 30, 2017 2:43 pm

Changing permissions of file in temp

Tue Nov 07, 2017 5:12 pm

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.
        
 
tim_beynart
Posts: 171
Joined: Wed Jul 15, 2015 8:30 am

Re: Changing permissions of file in temp

Thu Nov 09, 2017 8:49 am

did you try setting the permissions on the file to 777 before you deploy the app?
 
mahusa7
Topic Author
Posts: 14
Joined: Mon Oct 30, 2017 2:43 pm

Re: Changing permissions of file in temp

Thu Nov 09, 2017 9:12 am

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.
 
User avatar
RokuNB
Posts: 299
Joined: Fri Mar 31, 2017 2:22 pm

Re: Changing permissions of file in temp

Thu Nov 09, 2017 10:42 am

Said m3u8 is a small text file, right?
ReadAsciiFile()/WriteAsciiFile()
 
mahusa7
Topic Author
Posts: 14
Joined: Mon Oct 30, 2017 2:43 pm

Re: Changing permissions of file in temp

Thu Nov 09, 2017 11:38 am

WriteAsciiFile does not work as the file is read only when read from pkg.
 
User avatar
RokuNB
Posts: 299
Joined: Fri Mar 31, 2017 2:22 pm

Re: Changing permissions of file in temp

Fri Nov 10, 2017 6:04 pm

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)
 
User avatar
destruk
Posts: 2504
Joined: Sat Dec 18, 2010 4:58 pm

Re: Changing permissions of file in temp

Sun Nov 12, 2017 6:06 pm

That should work RokuNB, as it's writing it to tmp :)
 
mahusa7
Topic Author
Posts: 14
Joined: Mon Oct 30, 2017 2:43 pm

Re: Changing permissions of file in temp

Mon Nov 13, 2017 8:29 am

That does work. Thank you. :)

Who is online

Users browsing this forum: No registered users and 3 guests