TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Find Files (Ff) – File Search Utility in Rust

76 pointsby pvsukale3about 6 years ago

9 comments

robert_fossabout 6 years ago
There&#x27;s also fd[1], which is written in rust and is super fast.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;sharkdp&#x2F;fd" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sharkdp&#x2F;fd</a>
评论 #19262083 未加载
评论 #19263706 未加载
评论 #19263914 未加载
madmax96about 6 years ago
First, I have a problem with rewriting common utilities (like find, which also supports more search functionality than regex) while changing flags (e.g. `i` to ignore case to `s` - incidentally, grep also accepts `i` to ignore case). It makes it harder to explore the system interactively, particularly for beginners.<p>Second, the utility already exists, and this version is significantly slower:<p><pre><code> &gt; time .&#x2F;ff &#x27;.*.cpp&#x27; ~&#x2F;src&#x2F; &gt; &#x2F;dev&#x2F;null real 0m1.195s user 0m0.488s sys 0m0.671s &gt; time find -E ~&#x2F;src&#x2F; -type f -regex &#x27;.*.cpp&#x27; &gt; &#x2F;dev&#x2F;null real 0m0.880s user 0m0.407s sys 0m0.425s </code></pre> But wait! This is a totally unnatural use of find. If we use find like users actually do, we get even better performance:<p><pre><code> time find ~&#x2F;src&#x2F; -name &#x27;*.cpp&#x27; &gt; &#x2F;dev&#x2F;null real 0m0.553s user 0m0.181s sys 0m0.363s </code></pre> Hardly scientific. But it begs the question: who is this for?
评论 #19265576 未加载
评论 #19270350 未加载
评论 #19269028 未加载
imoverclockedabout 6 years ago
Here is a bash&#x2F;zsh port:<p>alias ff=&#x27;find . | egrep&#x27;
评论 #19262370 未加载
评论 #19263310 未加载
评论 #19262919 未加载
评论 #19261993 未加载
nurettinabout 6 years ago
Why do &quot;convert everything to rust&quot; people appear to prefer solving already solved problems instead of focusing on problems we could not solve but are now possible thanks to Rust?
评论 #19261852 未加载
评论 #19262073 未加载
评论 #19262259 未加载
评论 #19262434 未加载
评论 #19261828 未加载
评论 #19261804 未加载
评论 #19300015 未加载
评论 #19262274 未加载
评论 #19264800 未加载
评论 #19261978 未加载
wst_about 6 years ago
Someone already opened an issue to make it ignore files specified in `.gitignore`. A `fd` is doing it, `rg` is doing it, now someone wants this to behave the same. I don&#x27;t know. Maybe I have some really strange expectations but when I want to find a file and nothing comes up as a result, I want to be sure nothing is there. And I want to be sure without remembering bunch of command line options or setting up aliases everywhere I log in because, guess what, maybe they invented some other file with patterns to ignore. Is it only me?
评论 #19263509 未加载
评论 #19263470 未加载
评论 #19265761 未加载
评论 #19272748 未加载
saagarjhaabout 6 years ago
How does this compare to fd, which provides similar functionality and is also written in Rust?
评论 #19264112 未加载
vram22about 6 years ago
Here&#x27;s a simple version of a file find command utility, written in D, minimal features, may be useful for beginners to D:<p>Command line D utility - find files matching a pattern under a directory:<p><a href="https:&#x2F;&#x2F;jugad2.blogspot.com&#x2F;2016&#x2F;10&#x2F;command-line-d-utility-find-files.html" rel="nofollow">https:&#x2F;&#x2F;jugad2.blogspot.com&#x2F;2016&#x2F;10&#x2F;command-line-d-utility-f...</a><p>The D stdlib&#x27;s dirEntries() function makes the job easy, for a basic one like this.
评论 #19265777 未加载
sagartewari01about 6 years ago
What does this tool provide that I can&#x27;t get from a wrapper around gnu find?
评论 #19262099 未加载
评论 #19262910 未加载
评论 #19262488 未加载
评论 #19262931 未加载
评论 #19262279 未加载
chewbachaabout 6 years ago
That’s fun! I needed something like this and wrote my own a while ago. Choose to implement it with a different algorithm though instead of regex.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kbacha&#x2F;file-finder" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kbacha&#x2F;file-finder</a>