todds icon indicating copy to clipboard operation
todds copied to clipboard

Encoding skips following symlinks

Open dormieriancitizen opened this issue 1 year ago • 3 comments

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

dormieriancitizen avatar Sep 24 '24 23:09 dormieriancitizen

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.

joseasoler avatar Sep 27 '24 19:09 joseasoler

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.

dormieriancitizen avatar Sep 27 '24 20:09 dormieriancitizen

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.

joseasoler avatar Sep 28 '24 05:09 joseasoler