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

Encoding skips following symlinks #46

Open
dormieriancitizen opened this issue Sep 24, 2024 · 3 comments
Open

Encoding skips following symlinks #46

dormieriancitizen opened this issue Sep 24, 2024 · 3 comments

Comments

@dormieriancitizen
Copy link

Describe the bug
Encoding a folder seems to skip symlinks when searching for files to encode. That's fine if intended, but it would be nice to have a flag to toggle following/not following symlinks.

To Reproduce
Steps to reproduce the behavior:

  1. Make folder with symlink to other folder that contains a png file
  2. encode
  3. nothing gets encoded

Expected behavior

  1. png in other folder gets encoded

System (please complete the following information):

  • OS: Kubuntu 24.04
  • i7-6700t
@joseasoler
Copy link
Collaborator

Thank you for the report, @dormieriancitizen . I cannot reproduce this issue on Arch Linux after creating a symlink using ln -s, pointing to a folder with a single png file, and then pointing ToDDS to the symlink folder:

/home/joseasoler/dev/todds/cmake-build-debug/src/main/todds -v /home/joseasoler/delete/symlink
Retrieving files to be processed.
File retrieval time: 0.000 seconds.
/home/joseasoler/delete/test/some_texture.png
Processing 1 textures.

@dormieriancitizen
Copy link
Author

dormieriancitizen commented Sep 27, 2024

This isn't exactly what I mean; rather, creating a folder with a png, creating a symlink to that folder, placing that symlink in a parent folder, then pointing ToDDS at the parent folder; ie

mkdir regular_directory #place the PNG here
mkdir example_parent_directory
ln -s ../regular_directory example_parent_directory/symlink
todds -v example_parent_directory

This does not encode the PNG file placed in the regular directory. If I recreate symlink with an absolute instead of relative path, the PNG file in the regular directory is still not encoded.

@joseasoler
Copy link
Collaborator

joseasoler commented Sep 28, 2024

One thing to mention is that ToDDS has a bug which will prevent it from finding any files unless -ss or -r are used to explicitly choose a filter. Does using one of these parameters help with the situation? EDIT: This bug is now fixed in latest.

Since the ln -s command in your example uses ../regular_directory, I am assuming that example_parent_directory has a parent folder, which is in the same folder as regular_directory, so something like this:

  • parent_directory
    • png_directory (regular_directory in your example)
    • second_parent_directory
      • third_parent_directory (example_parent_directory in your example)
        • symlink
rm -rf regular_directory
mkdir parent_directory
cd parent_directory
mkdir png_directory
cp ../image.png png_directory
mkdir second_parent_directory
cd second_parent_directory
mkdir third_parent_directory
ln -s ../png_directory third_parent_directory/symlink
~/dev/todds/cmake-build-debug/src/main/todds -v -ss png third_parent_directory/symlink
Retrieving files to be processed.
File retrieval time: 0.000 seconds.
/home/joseasoler/delete/parent_directory/png_directory/image.png
Processing 1 textures.

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