On this page
  1. posix.fchown
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

posix.fchown

Prev: posix.fchmod | Up: posix | Next: posix.fork
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org — posix.fchown
Tags: #public #python3 #stdlib #posix


Import

import posix
from posix import fchown

Signature & Overview

posix.fchown(fd, uid, gid)

Change the owner and group id of the file specified by file descriptor.

Usage

import os, tempfile

with tempfile.TemporaryFile() as f:
    os.fchown(f.fileno(), os.getuid(), os.getgid())

Gotchas

REPL Inspect

from posix import fchown
help(fchown)

Linked from

Related notes