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

File access errors when OSP-Magnum not started from the build directory. #272

Open
IronPepper3964 opened this issue May 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@IronPepper3964
Copy link
Contributor

IronPepper3964 commented May 5, 2024

osp-magnum can only be started from the local build folder. If it is started from any other directory, multiple errors occur due to relative file locations changing.

Example:

When running ./osp-magnum from the Release folder created during the build, the program runs as expected - no errors

~/build-osp-magnum/Release$ ./osp-magnum

However, when running ./build-osp-magnum/Release/osp-magnum from the root folder where both the osp-magnum and build-osp-magnum folders are stored, multiple files cannot be found

~/$ ./build-osp-magnum/Release/osp-magnum

Errors:

Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/spamcan.sturdy.gltf
[15:12:11.529] [testapp] [error] [load_tinygltf.cpp:342] Could not open file OSPData/adera/spamcan.sturdy.gltf
Utility::Path::read(): can't open OSPData/adera/stomper.sturdy.gltf: error 2 (No such file or directory)
Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/stomper.sturdy.gltf
[15:12:11.529] [testapp] [error] [load_tinygltf.cpp:342] Could not open file OSPData/adera/stomper.sturdy.gltf
Utility::Path::read(): can't open OSPData/adera/ph_capsule.sturdy.gltf: error 2 (No such file or directory)
Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/ph_capsule.sturdy.gltf
[15:12:11.529] [testapp] [error] [load_tinygltf.cpp:342] Could not open file OSPData/adera/ph_capsule.sturdy.gltf
Utility::Path::read(): can't open OSPData/adera/ph_fuselage.sturdy.gltf: error 2 (No such file or directory)
Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/ph_fuselage.sturdy.gltf
[15:12:11.529] [testapp] [error] [load_tinygltf.cpp:342] Could not open file OSPData/adera/ph_fuselage.sturdy.gltf
Utility::Path::read(): can't open OSPData/adera/ph_engine.sturdy.gltf: error 2 (No such file or directory)
Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/ph_engine.sturdy.gltf
[15:12:11.529] [testapp] [error] [load_tinygltf.cpp:342] Could not open file OSPData/adera/ph_engine.sturdy.gltf
Utility::Path::read(): can't open OSPData/adera/ph_rcs.sturdy.gltf: error 2 (No such file or directory)
Trade::AbstractImporter::openFile(): cannot open file OSPData/adera/ph_rcs.sturdy.gltf
[15:12:11.529] [testapp] [error] [load_tinygltf.cpp:342] Could not open file OSPData/adera/ph_rcs.sturdy.gltf
[15:12:11.529] [testapp] [info] [main.cpp:409] Resource loading complete

The OSP-Magnum Temporary Debug CLI loads, but selecting any scenario causes an error and the program closes

terminate called after throwing an instance of 'std::ios_base::failure[abi:cxx11]'
  what():  toml::parse: Error opening file "settings.toml": iostream error
Aborted (core dumped)```

@Capital-Asterisk
Copy link
Contributor

Probably best to use the executable's file path instead of the current directory. We'd only need changes to main.cpp most likely.

@Capital-Asterisk Capital-Asterisk added the bug Something isn't working label May 26, 2024
@SparklesReal
Copy link

This is fixed atleast in some parts in #297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants