Page MenuHomeFeedback Tracker

New function LoadBytesFile or LoadFileBase64
New, NormalPublic

Description

I propose a new function LoadBytesFile that would work exactly like LoadFile but instead of returning a string, it would return an array of number representing the byte array of the content of the file. Another way would be to return file content in base64 format.
Why ?

  • Because actually we cannot read a sound or a video stored in a PBO with a DLL. Sound files and video files are made of non visual characters that would not be returned with LoadFile. Currently, if i want to read a sound or a video or any other kind of file with non visual characters, i need to base64 encode this file first and then store it in the PBO. I think this is particularly in the opposite of the modding and sharing spirit of Arma.

This is why i would appreaciate a LoadBytesFile function to return file content in byte array format or a LoadFileBase64 function, which can be easily read by an extension.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 11 x64
Operating System Version
23H2
Category
Scripting

Event Timeline

XTankKiller renamed this task from New function LoadBytesFile to New function LoadBytesFile or LoadFileBase64.Jun 9 2024, 8:50 PM
XTankKiller updated the task description. (Show Details)

+1 on reading a binary file.

Attempting to load this bson file will cause arma to only read the @.

Array returns should be ignored and only focus on binary reading of the file as a string.

dedmen added a subscriber: dedmen.Jun 10 2024, 3:32 PM

Because actually we cannot read a sound or a video stored in a PBO with a DLL.

Why can't you?
Just read the pbo. I didn't have any problems doing that with TacControl, it loads paa textures (for map markers) straight out of pbo.
As long as its not a ebo (which this script command wouldn't be allowed to read anyway), you can already do this.