-
Notifications
You must be signed in to change notification settings - Fork 188
Interpret bytes as packed binary data #621
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
Comments
I am not sure to understand the details. |
Sorry if I was not clear. Currently in Fortran it is a lot more verbose to do the same thing with bare intrinsics. |
I believe he's interested in utilities for serialization/deserialization of a data structure. At its heart it is the call copy_to_bytes(var, buffer, offset) would turn the variable PS: I have such procedures, but for some reason I implemented them using |
Yes this is exactly what I mean. |
Is this task related to the FD thread: Bytearray for socket packets? Me gut feeling is the For the buffer there is the possibility to use |
Yes it is, thanks again for your help on that. Code from that question is here, though it needs a tidy up.
I suppose you could have it as int8, and then have a to_char or print routine? |
Motivation
I've recently had cause to write Fortran code that communicates over a socket, and code that reads a structured binary file format. For both of these I needed to write routines that could read n bytes and convert those bytes into characters, integers etc or write integer, characters etc into n bytes.
Prior Art
Pythons struct, particularly the pack and unpack routines.
Szaghi's BeFoR64 pack_data routine.
Additional Information
No response
The text was updated successfully, but these errors were encountered: