I am trying to copy/move files with Gio.File
. I can move files with following code using paths
from gi.repository import Gio
src = Gio.File.new_for_path('a')
dst = Gio.File.new_for_path('b')
src.move(dst, Gio.FileCopyFlags.NONE)
It works fine. But as soon as I try something like following
from gi.repository import Gio
src = Gio.File.new_for_path('a')
dst = Gio.File.new_for_uri('admin:///b')
src.move(dst, Gio.FileCopyFlags.NONE)
It doesn’t work anymore. It gives following error
gi.repository.GLib.GError: g-io-error-quark: Operation not supported (15)
I also tried read()
, open_readwrite()
, etc. functions, they all give above error or ‘Not mounted (16)’ error if file(s) are created using Gio.File.new_for_uri()
constructor.
What is the way to do it?