News for hackers. Stuff that matters.
Re:Sloth – A Mac app that shows all open files, directories,... by johtso on Thursday February 16, 2023 @07:42PM (#34829047)
I wish there was a way to see which files were being actively written to sorted by amount of data written. Various times I've seen my disk space rapidly dwindling with no way of know what file was responsible..
Re:Sloth – A Mac app that shows all open files, directories,... by miles on Thursday February 16, 2023 @08:21PM (#34829407)
FSMonitor[0] is similar to the old FileMon[1] but for macOS.

In the default tree view, as new data is written, the entries are highlighted and sort of throb, so it's easy to track what's going on.

[0] https://fsmonitor.com/

[1] https://learn.microsoft.com/en-us/sysinternals/downloads/fil...

Re:Sloth – A Mac app that shows all open files, directories,... by brigandish on Thursday February 16, 2023 @08:24PM (#34829431)
Happened to me this morning, something filled up my drive in minutes. I used dust[1] to look for large files while it was happening but knowing what was doing it would've been a big help.

[1] https://github.com/bootandy/dust

Re:Sloth – A Mac app that shows all open files, directories,... by yehaaa on Thursday February 16, 2023 @08:22PM (#34829412)
Check out rwsnoop, included in macOS. It use Dtrace to trace the read/write syscalls. You need to turn off SIP for Dtrace though afaik.
Re:Sloth – A Mac app that shows all open files, directories,... by pram on Thursday February 16, 2023 @08:00PM (#34829229)
Activity monitor shows what’s being written and the accumulative R/W by process. Wouldn’t be too hard to look at lsof and figure it out.
Re:Sloth – A Mac app that shows all open files, directories,... by krono on Thursday February 16, 2023 @09:12PM (#34829811)
If you'd rather spend some of your time than your money on this, you can use the built-in fs_usage terminal command and filter its output (e.g. with grep). Works even with SIP enabled, but will then obviously only return information that SIP doesn't cover.

More info:

  man fs_usage
Example showing pathname-only events but otherwise unfiltered:

  sudo fs_usage -ew -f pathname
Re:Sloth – A Mac app that shows all open files, directories,... by Jakob on Thursday February 16, 2023 @09:34PM (#34829979)
I used this incantation in the past to get the hottest file paths

  $ sudo fs_usage -w -t 5 -f filesys | tee fs_usage.log | egrep -o '(/.+?) {3}' | sed -e 's/\/dev\/disk[^ ]+  //' | sort | uniq -c | sort -nr
From https://www.jakobstoeck.de/2017/ramdisk-for-faster-applicati...
Re:Sloth – A Mac app that shows all open files, directories,... by colonCapitalDee on Thursday February 16, 2023 @10:28PM (#34830364)
I'm going to start calling command line commands "incantations"
Re:Sloth – A Mac app that shows all open files, directories,... by codetrotter on Thursday February 16, 2023 @10:31PM (#34830382)
I think you might enjoy this poster then: https://www.reddit.com/r/linux/comments/ifmoua/ive_finally_f...

Have a look at the writings on the books, the pots, etc, in that picture and I think you will see what I mean ;)

You might have to open the picture on a laptop or desktop computer to get a good look at it. On mobile it might be more difficult to see it proper.

It’s my favorite poster that I have ever seen. One of these days I will get myself a nice physical copy of it.

Re:Sloth – A Mac app that shows all open files, directories,... by colonCapitalDee on Friday February 17, 2023 @03:38AM (#34832313)
I have a copy of that poster hanging on my wall!!
Re:Sloth – A Mac app that shows all open files, directories,... by codetrotter on Friday February 17, 2023 @05:11AM (#34832910)
Even better!
Re:Sloth – A Mac app that shows all open files, directories,... by jcynix on Friday February 17, 2023 @03:12AM (#34832154)
And as (American?) English speakers tend to abbreviate almost everything ("app", "fridge" ...) we might end at "cantos" then.

https://en.wikipedia.org/wiki/Canto ... I'm currently reading Dan Simmons' Hyperion/Endymion again, which might have pushed that into my mind.

Re:Sloth – A Mac app that shows all open files, directories,... by jalcazar on Friday February 17, 2023 @02:56AM (#34832052)
iotop ?
Re:Sloth – A Mac app that shows all open files, directories,... by sva_ on Friday February 17, 2023 @08:03AM (#34834147)
On Linux, this can be done using BPF (Berkley Packet Filter). In fact there is a tool in BCC[0] called filetop, which lists reads/writes by process and file[1].

0. https://github.com/iovisor/bcc

1. https://github.com/iovisor/bcc/blob/master/tools/filetop.py

Re:Sloth – A Mac app that shows all open files, directories,... by astrange on Friday February 17, 2023 @07:28PM (#34842527)
Not sure you can do that 100% of the time, since programs can write to unlinked files and I'm not sure those remember what their paths were.