Hi On Mon, Apr 9, 2012 at 6:38 AM, Rupesh Khetawat <Rupesh_Khetawat@symantec.com> wrote:
Is there anyway a file can be deleted in KEXT?
I have written KEXT where file scope listener is registered with kauth. I am trying to delete certain files when the action is close with modified flag. I looked at the documentation, but did not find anything deleting file in kernel mode.
Can someone throw some light on this?
In kernel you do not have access to POSIX functions such as unlink(). I believe the only way to achieve the goal is to use VNOP operations directly. In your case this will be VNOP_REMOVE. Here is an example from XNU that removes a file https://github.com/anatol/xnu/blob/master/bsd/vfs/vfs_xattr.c#L529 _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com
participants (1)
-
Anatol Pomozov