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

Use argv[0] (the first file name) instead of 'c' as the prefix for the cashed binary. #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sebastiancarlos
Copy link

@sebastiancarlos sebastiancarlos commented Nov 25, 2023

Hey there. Here's another change that I made for myself. Feel free to merge if you like it.

The idea is to change the cashed file names for greater recognizably and a chance to auto-complete the file name.

This is useful if one wants to debug, trace, or do something else with the cached file instead of running it, but one does not want to take too much time figuring out which file is the one you want.

For example, the cache directory might currently look like this:

/tmp/c.cache.user/c5b2d83aab43bf35b4ecfcf05314f3a95.bin
/tmp/c.cache.user/c612d947ebd92b41dc3e9a8714b11a891.bin
/tmp/c.cache.user/cbe2a1fd1436c5facd83bb12b1bf89baf.bin

But with this change, the same directory would look like this:

/tmp/c.cache.user/send_email.c.hash_5b2d83aab43bf35b4ecfcf05314f3a95.bin
/tmp/c.cache.user/fetch_news.cpp.hash_612d947ebd92b41dc3e9a8714b11a891.bin
/tmp/c.cache.user/conquer_world.for.hash_be2a1fd1436c5facd83bb12b1bf89baf.bin

Sure, then can be multiple cashed binaries for the same file name at the same time, but I feel like this helps in some cases. Modified date helps to disambiguate.

I chose to remove the c prefix because, by default, the container folder already indicates that the c tool is responsible for these files.

I added the .hash_ part so that, at quick glance, it can be noted that following string is meant to be a hash and that this is not some sort of file with multiple extensions.

All tests pass.

Have a nice day!

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.

None yet

1 participant