Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View of binary files #131

Closed
ekouts opened this issue Nov 29, 2021 · 2 comments
Closed

View of binary files #131

ekouts opened this issue Nov 29, 2021 · 2 comments
Assignees

Comments

@ekouts
Copy link
Collaborator

ekouts commented Nov 29, 2021

I am basically copying this issue by @giovannipizzi from pyFirecREST: eth-cscs/pyfirecrest#7

Currently, a GET to /utilities/view returns a string with the given file content. Would it be possible to have a binary version of it?
E.g. if I do view of a tar.gz i get

Status code: 400
JSON: {'description': 'Error on head operation', 'error': "'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte"}: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

More generally (maybe this is not intended for binary files?) it would be important also for text files, in case e.g. they were written in some other non UTF-8 encoding, that would likewise fail.

@jpdorsch jpdorsch self-assigned this Jan 26, 2023
@jpdorsch
Copy link
Collaborator

The idea of this endpoint is to see the content of a plain text file, thinking on the use case of checking what is being written in SLURM output or error files, or to show configuration files of a simulation, for instance.

I wouldn't use this to check the content of a binary file, moreover, if you try to see the content of a binary file without specific software you would get bytes without proper encoding (I guess).

In the case you are mentioning, we can try to include UTF-8 files in the same endpoint.

@jpdorsch
Copy link
Collaborator

This was clarified in the openapi doc here

summary: View the content of a plain text file (UTF8)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants