Giter Club home page Giter Club logo

sveinbjornt / searchfs Goto Github PK

View Code? Open in Web Editor NEW
108.0 11.0 8.0 109 KB

Command line tool to quickly search by filename on entire APFS and HFS+ volumes using the file system catalog.

Home Page: https://sveinbjorn.org/searchfs

License: BSD 3-Clause "New" or "Revised" License

Objective-C 67.86% Roff 9.09% HTML 12.28% Makefile 1.61% Python 9.16%
volume catalog-search macos macosx apfs-volumes apfs hfs-filesystem search searchfs command-line-tool

searchfs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

searchfs's Issues

Please support DESTDIR in Makefile

Please support the standard DESTDIR variable in your Makefile.

If I run

sudo make install DESTDIR=/tmp/root

then I would expect the files to get installed in

/tmp/root/usr/local/bin/searchfs
/tmp/root/usr/local/share/man/man1/searchfs.1

Note that your existing Makefile variable DEST_DIR, which serves an unrelated purpose, then becomes confusing. You may wish to rename that variable.

Compiler warnings on Mojave

On macOS 10.14.4 with Xcode 10.2.1, I git pulled to update my clone, and did make. I saw the following warnings that I don't remember seeing before:

version-min=10.7 main.m
main.m:419:24: warning: 'fsgetpath' is only available on macOS 10.13 or newer
      [-Wunguarded-availability-new]
        ssize_t size = fsgetpath(buf, buflen, fsid, obj_id);
                       ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/sys/fsgetpath.h:46:9: note:
      'fsgetpath' has been marked as being introduced in macOS 10.13 here, but
      the deployment target is macOS 10.7.0
ssize_t fsgetpath(char *, size_t, fsid_t *, uint64_t) __OSX_AVAILABLE(10...
        ^
main.m:419:24: note: enclose 'fsgetpath' in an @available check to silence this
      warning
        ssize_t size = fsgetpath(buf, buflen, fsid, obj_id);
                       ^~~~~~~~~
1 warning generated.
strip -x searchfs

The build succeeded despite the warnings.

Support other file systems?

This is not really a "issue", and I realise that it's not even a feature request, but I still wanted to discuss the possibilities.

Is it possible to add support for other file systems?

Are there any other file systems which have Catalog of files? I guess NTFS does. (as Everything uses it for search)

But do you know if ext3/4 or any other linux file systems have this?

"Unable to get path for object ID"

(snip)
/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app
Unable to get path for object ID: 3430632Unable to get path for object ID: 3460180/Applications/Video/Adapter.app
/Applications/Video/MediaInfo.app
(snip)

This happens multiple times in the results, for different object IDs.

Let me know if/how I can provide more logging or diagnostics.

Please support alternate installation prefixes

The Makefile is hardcoded to install into /usr/local. Please provide a Makefile variable (perhaps PREFIX) that a user could specify at the command line to install to a different location.

Unable to search /System/Volumes/Data ?

Catalina 10.15.3

searchfs seems unable to search the r/w mountpoint where all user data is stored. Tried v0.3 from https://sveinbjorn.org/files/software/searchfs.zip as well as compiling from master - same result:

$ ./searchfs -l
/dev/disk1s5 (apfs): /
/dev/disk1s1 (apfs): /System/Volumes/Data
/dev/disk1s4 (apfs): /private/var/vm
/dev/disk2s2 (hfs ): /Volumes/TimeMachine

$ ./searchfs -v / USBDriverKit.framework$
/System/DriverKit/System/Library/Frameworks/USBDriverKit.framework
/System/Library/Frameworks/USBDriverKit.framework

$ ./searchfs -v /System/Volumes/Data foo
Not a volume mount point: /System/Volumes/Data

$ ./searchfs -v /dev/disk1s1 foo
Not a volume mount point: /System/Volumes/Data

Not sure if it matters, but I also tried granting the binary Full Disk Access, which did not make any difference. Am I doing something wrong?

Only scan a specific directory?

one of my common workflow scripts searches for all .app files in /Applications and then processes them.

Currently I do this:

mdfind -onlyin /Applications "kMDItemFSName == *.app"

real 0m1.009s
user 0m0.023s
sys 0m0.027s

an slower alternative would be:

find "/Applications" -iname "*.app" -exec echo {} \;

real 1m20.565s
user 0m6.577s
sys 0m29.990s

however searchfs is even slower than this as i have to scan the whole volume and filter the results:

searchfs ".app" | grep -E "^/Applications.+app$"

real 2m7.277s
user 0m0.108s
sys 0m46.177s

So it would be useful if searchfs could operate on the cwd or a directory passed as an argv?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.