Gio.File.prototype.dup

function dup(): Gio.File {
    // Gjs wrapper for g_file_dup()
}
  

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

This call does no blocking I/O.

Returns

a new Gio.File that is a duplicate of the given Gio.File.