gFileQueryInfo
and as such does blocking I/O.gFileQueryExists(object, cancellable = NULL)
object
GFile
.cancellable
GCancellable
object, NULL
to ignore.TRUE
if the file exists (and can be detected without error), FALSE
otherwise (or if cancelled).gFileCreate
which will either atomically create the file
or fail with a G_IO_ERROR_EXISTS error.
However, in many cases an existence check is useful in a user
interface, for instance to make a menu item sensitive/insensitive, so that
you don't have to fool users that something is possible and then just show
and error dialog. If you do this, you should make sure to also handle the
errors that can happen due to races when you execute the operation.