asl
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2019
02:36 AM
Working with files
Hello, I'm trying to work with files and the only way I can find is by using the "roByteArray" object and it lacks some basic operations like:
- Truncate a file to a certain size
- Read/Write a text file per lines
Text lines can be manually implemented with ReadFile and WriteFile functions, but what about truncating a file? Is there any other way of working with files besides "roByteArray"? How can I truncate a file at a certain position?
Thanks.
- Truncate a file to a certain size
- Read/Write a text file per lines
Text lines can be manually implemented with ReadFile and WriteFile functions, but what about truncating a file? Is there any other way of working with files besides "roByteArray"? How can I truncate a file at a certain position?
Thanks.
1 REPLY 1
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2019
12:18 PM
Re: Working with files
To truncate, you have to either read in only the part you're interested in and write it back out or read in the whole file and only write out the part you're interested in.
From ifByteArray:
ReadFile(path as String, start_index as Integer, length as Integer) As Boolean
WriteFile(path as String, start_index as Integer, length as Integer) As Boolean
-JT
From ifByteArray:
ReadFile(path as String, start_index as Integer, length as Integer) As Boolean
WriteFile(path as String, start_index as Integer, length as Integer) As Boolean
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.