Skip to content

Fix import/export on *nix systems#4

Open
amberstarlight wants to merge 2 commits intoDummiesman:masterfrom
amberstarlight:fixes-for-nixes
Open

Fix import/export on *nix systems#4
amberstarlight wants to merge 2 commits intoDummiesman:masterfrom
amberstarlight:fixes-for-nixes

Conversation

@amberstarlight
Copy link

@amberstarlight amberstarlight commented Jul 30, 2023

I have:

  • Set struct.unpack and struct.pack to always use little-endian and standard sizes.
  • Created a basic case-insensitive file loader.
  • Added a .gitignore

Reasoning:

  • Errors such as unpack requires a buffer of x bytes are due to differences in systems' native sizes for types. For example, unsigned longs on Windows are 4 bytes but on other sytems they are 8. Thus, we should use the standard sizing and not the native system sizing as this isn't portable.

    • Realistically, the only systems this will be run on are x86, x86_64, or ARM which are all modern architectures using little-endian encoding, so I've chosen to force little endian everywhere.
  • The importing works fine on Windows because, despite NTFS being case-sensitive, functionally it isn't for software. To make this portable we should do thorough checks. I've chosen to do the simplest method here and listdir the directory to search and compare lowercased filenames.

  • Added a gitignore because, while testing this repo, I ended up with lots of .pyc files which we don't want in the repo.

Closes (I think!):

We should use the standard size and little-endian. Realistically, the
only systems this will be run on are x86, x86_64, or ARM which are all
modern architectures using little-endian encoding. We should also make
sure we are using standard sizes. Unsigned longs on Windows are 4 bytes
but on other sytems they are 8, so we should use the standard sizing,
not the native system sizing as this isn't portable.
@amberstarlight amberstarlight changed the title Fix import on *nix systems Fix import/export on *nix systems Jul 31, 2023
+ Use little-endian on all struck.pack and struct.unpack calls
+ Use case-insensitive file finder
+ Add .gitignore
+ Update addon version
+ Update README
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

Successfully merging this pull request may close these issues.

1 participant