File.dup

Duplicates a #GFile handle. This operation does not duplicate the actual file or directory represented by the #GFile; see gio.file.File.copy if attempting to copy a file.

gio.file.File.dup is useful when a second handle is needed to the same underlying file, for use in a separate thread (#GFile is not thread-safe). For use within the same thread, use gobject.object.ObjectG.ref_ to increment the existing object’s reference count.

This call does no blocking I/O.

interface File
dup
()

Return Value

Type: gio.file.File

a new #GFile that is a duplicate of the given #GFile.