YouTip LogoYouTip

Os Fchown

# Python2.x Python os.fchown() Method [![Image 3: Python File Methods](#) Python OS File/Directory Methods](#) * * * ### Overview The os.fchown() method is used to change the ownership of a file. This function modifies the user ID and user group ID of a file, which is specified by the file descriptor fd. Available on Unix. ### Syntax The syntax format of the **fchown()** method is as follows: os.fchown(fd, uid, gid) ### Parameters * **fd** -- File descriptor * **uid** -- User ID of the file owner * **gid** -- User group ID of the file owner ### Return Value This method does not return a value. ### Example The following example demonstrates the use of the fchown() method: #!/usr/bin/python# -*- coding: UTF-8 -*-import os, sys,
← Linux Comm FbsetOs Fchown β†’