-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Symlink to symlink to file preload support #128
base: main
Are you sure you want to change the base?
Conversation
There is one problem though: recursive symlinks cause an exception and I have no idea how it's better to handle it in this program. Should it become a parse error, or a debug log, or exception is fine? |
probably debug log |
..so I viewed code a little bit more - and turns out, every call to For now, I'll leave this pull request as is, sorry. I can't go right here through multiple parts of the project to handle every |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we use canonical
?
sure, we probably can just write a wrapper func in the future |
That works too, but also checks whether a file exists (throws an exception/returns an error if it doesn't). And |
yes but canonical is 1 line meanwhile your thing is like 10 |
Hm.. Then, it may be better to remove exist check in src/config/ConfigManager.cpp (line 70), replace it with |
exist check won't crash, and it shouldn't. We can leave it intact. |
It indeed shouldn't crash: instead of throwing an exception,
But it takes near-same amount of lines |
I still prefer not rewriting STL functions we already included |
My last written solution is not rewriting any STL functions, as we can see. What's the problem? |
canonical does the same in my eyes. It won't throw because of a non-existent file because we check for that. |
But there is a (albeit very small) possibility that a file gets removed between config parsing and wallpaper target creation. I think best way is to check for file existance only once - that is, only when actually preloading the image. Filesystem is volatile, and changes independently of our program, so sequent checks mean nothing. |
Hi. I stumbled upon this pretty nice software, but immediately encountered a problem: hyprpaper can preload only a path to file or path to a symlink that gets dereferenced once. Symlinks to symlinks do not work - well, not anymore :)