3

If Nautilus is used to drop a file on a samba share into an app, then the app will see: "SMB://server/share/file"

How is the app supposed to detect real, working gvfs path of that file ? different Ubuntu versions have different paths to the gvfs folder.

is there an API, or conversion script, or anything like that, that could translate that into the ull GVFS path ?

1
  • What do you mean "full GVFS path" exactly? The smb://host/share/file URL is the path that apps using GVFS for file I/O would use to access the file.
    – dobey
    Nov 6, 2012 at 14:21

1 Answer 1

2

Use GIO GVfs, for example in Python:

#!/usr/bin/env python
from gi.repository import Gio

uri='SMB://server/share/file'

gvfs=Gio.Vfs.get_default()
path=gvfs.get_file_for_uri(uri).get_path()
print path
1
  • Hey Mr. Florian. Thanks for your answer. I am trying to use your code for accessing SMB file, but this code is giving output with "None". If it is any type of change, can you please update your code? Thanks in advance.
    – dtc348
    Mar 7 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.