fd icon indicating copy to clipboard operation
fd copied to clipboard

Add ability to disable cache

Open the-r3dacted opened this issue 5 months ago • 5 comments

I use fd for one purpose, which is I move files into a directory, use fd to execute a program and modify those files, then I move them back out. I could use something else, but I want to use fd because it's fast and parallelized,

Except fd seems to remember those files were there, and tries to access them again after I move them out when I do another batch. This gets really annoying having to wait for it to go through thousands of errors.

However since I have already done the big batch (3000+ files), maybe I could just use something else, but fd would still be faster if it were possible to disable caching.

Image

The command I use

fd . --type file --extension ogg -x optivorbis {} OptiVorbis/{.}.ogg

the-r3dacted avatar Jul 19 '25 01:07 the-r3dacted

I'm not sure what causes that, but fd does not have any kind of cache.

tmccombs avatar Jul 19 '25 16:07 tmccombs

what?

The following benchmarks are performed with a "warm"/pre-filled disk-cache (results for a "cold" disk-cache show the same trends).

the-r3dacted avatar Jul 25 '25 15:07 the-r3dacted

That is referring to the operating system's cache, not anything specific to fd

tmccombs avatar Jul 25 '25 20:07 tmccombs

Do you maybe need to quote the curly braces? Maybe your shell is doing something with those that is interfering with the process?

Or maybe there is some kind of race condition.

Try putting an echo in front of the command you run so you can see waht commands fd is actually trying to run

tmccombs avatar Jul 26 '25 06:07 tmccombs

I tried adding curly braces, same issue.

I'm not entirely sure what you mean by "Try putting an echo in front of the command you run", but I tried doing echo on, tried putting echo before fd, tried doing echo fd, tried adding echo to the fd command and it either did nothing at best or broke the command at worst.

the-r3dacted avatar Jul 26 '25 19:07 the-r3dacted