This question is really more for my fellow computer scientists: how does the Put Back feature of the Trash directory work? I'm guessing the OS maintains some sort of index file which stores the path to the current location of the file before moving it to the Trash? Of course, this would be a bit more nuanced with non-empty directories...
Everything that was returned in an admittedly brief Web search had to do with end-user interaction with the Trash. I would like to know how OS X is doing this "under the hood" so that I can emulate the same handling in a script that I am writing.
ls -l@
to see some? extended attributes; I forget how to actually look at them, but the Internet can tell you that. – Hawken MacKay Rives Apr 23 '16 at 02:40