0

I'm writing a code for fanotify to listen a filesystem, but I'm having trouble writing a file move-in and move-out event, and I'd like to ask if a file is moved in a file system that's being listened to. Do their MOVED_FROM and MOVED_TO match? That is, there must be MOVED_FROM before MOVED_TO? If it's not a match, is there any way to find the moved file by a unique identifier, recording their addresses before and after the move?

Documentation and code description of the Linux kernel

xzq
  • 21
  • 1
  • Welcome to stackoverflow.com. Please take some time to read [the help pages](http://stackoverflow.com/help), especially the sections named ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](http://stackoverflow.com/help/dont-ask). Also please take the [tour] and read about [ask]. Lastly please read [how to write the "perfect" question](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/), especially its [checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/). – Some programmer dude Jul 26 '23 at 07:38
  • Think you'll just get `FAN_RENAME` if moving within your watched folder https://man7.org/linux/man-pages/man7/fanotify.7.html – Alan Birtles Jul 26 '23 at 07:41
  • My kernel version is 5.10, so the FAN_RENAME mark does not exist. – xzq Jul 26 '23 at 07:48

0 Answers0