Re: Current Directory of a Process
Initially I want to create a log for auditing purposes of all files opened/created/renamed/deleted and all programs executed. All of these things can be done with relative pathnames which is why I need the ability to get the current working directory of a process. Later on I would like to be able to redirect or disallow any of these actions. I'm not worried about disappearing paths or of the many path's to a file, I monitor delete attempts and I need any one path to log. I am open to any suggestions. Robert Sandilands On Wednesday, June 11, 2003, at 11:49 AM, Jim Magee wrote: On Wednesday, June 11, 2003, at 11:03 AM, Robert Sandilands wrote: It's the same issue trying to translate any other open file (directory) to a path. You can't! At least not reliably. For one thing, there might not be a path anymore (the last link to the file/directory was deleted while you had an open reference to it). This is perfectly legal in BSD. For another, with hard-links, there may be MANY paths to the open file (not an issue with directories because of the inability to hard-link to a directory). Not all of which your application can use (because of permissions on intervening directories). Again, we have to ask "what are you trying to accomplish?" It sounds like you may need to re-factor which parts of your application belong in user space and which parts belong in the kernel. --------------------------------------------------------------------- #include http://robert.rsa3.com/disclaimer.html _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Robert Sandilands