blacktop / go-apfs

APFS parser written in pure Go
Apache License 2.0
66 stars 3 forks source link

Add recursive ls #4

Open nicolas17 opened 2 years ago

nicolas17 commented 2 years ago

I would like to get the entire filesystem tree of an APFS dmg. Currently apfs ls only shows a single directory, and running repeated apfs ls foo.dmg /some/directory for every subdirectory found on previous commands is extremely slow. It would be useful if ls had a recursive option. Or maybe a new sub-command...

blacktop commented 2 years ago

That feature is in the works here: https://github.com/blacktop/go-apfs/blob/df468843bd5f54a721162205a2f02e5d180bc6a7/apfs.go#L299

It's output will be similar to:

❯ tree /Volumes/SkySeed19A5261w.N104N841DeveloperOS/etc/
/Volumes/SkySeed19A5261w.N104N841DeveloperOS/etc/
├── asl
│   ├── com.apple.NanoFindMy-UserStudy
│   ├── com.apple.airplay.ios
│   ├── com.apple.clouddocs
│   ├── com.apple.contacts.ContactsAutocomplete
│   ├── com.apple.nano-fmld
│   ├── com.apple.nanosetup
│   ├── com.apple.networking.boringssl
│   └── com.apple.networking.usbethernet
├── asl.conf
├── group
├── hosts
├── hosts.equiv
├── master.passwd
├── networks
├── notify.conf
├── passwd
├── ppp
├── protocols
├── racoon
│   ├── psk.txt
│   ├── racoon.conf
│   └── remote
│       └── anonymous.conf
├── services
└── ttys

4 directories, 22 files
blacktop commented 2 years ago

Is that similar to what you were thinking?

CRKatri commented 2 years ago

That will be extremely useful for me too. I would also appreciate if you could extend the shell completion to autocomplete directory names in the dmg, and perhaps even add a interactive shell to do that from without having to constantly. retype apfs ls dmgname.dmg I could just type ls and cp as if it was a real shell.