Re: Deleting a file in KEXT
Re: Deleting a file in KEXT
- Subject: Re: Deleting a file in KEXT
- From: Anatol Pomozov <email@hidden>
- Date: Tue, 10 Apr 2012 13:49:47 -0700
Hi
On Mon, Apr 9, 2012 at 6:38 AM, Rupesh Khetawat
<email@hidden> 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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden