As for our last permissions and access related methods, today we talk about the 𝗰𝗵𝗼𝘄𝗻 method.
It lets you change the ownership of a file. Just like you're used to on your terminal:
𝗰𝗵𝗼𝘄𝗻 <𝗨𝘀𝗲𝗿><:><𝗚𝗿𝗼𝘂𝗽> <𝗙𝗶𝗹𝗲>
𝗡𝗼𝗱𝗲𝗷𝘀 provides support for it natively; so you won't have to spawn a process to access this API.
You can check the updated values with this basic list command:
𝗹𝘀 -𝗹 <𝗙𝗜𝗟𝗘>
Did you learn something new today?
Like and share this post, and follow me for more!