I cant repro the behavior outside of `snap` it seems: ``` #include <stdio.h> #include <glib.h> #include <gio/gio.h>
void print_type (const char* file_uri) { GFile* my_file = g_file_new_for_uri(file_uri); char* path = g_file_get_path(my_file); fprintf (stdout, "uri:%s => path:%s\n", file_uri, path); g_object_unref(my_file); }
int main (void) { const char* files[] = { "smb://192.168.1.36/documents/Patches/QPdfPresenterConsole-2.7.0-Darwin-x86_64.zip", }; int num_files = sizeof(files)/sizeof(files[0]); for(int f = 0; f < num_files; ++f) { print_type(files[f]); } return 0; } ```
build with ``` gcc gio-test-files.c `pkg-config --cflags --libs glib-2.0 --libs gio-2.0` -o gio-test-files ```
and running: ``` $ ./gio-test-files uri:smb://192.168.1.36/documents/Patches/QPdfPresenterConsole-2.7.0-Darwin-x86_64.zip => path:/run/user/1000/gvfs/smb-share:server=192.168.1.36,share=documents/Patches/QPdfPresenterConsole-2.7.0-Darwin-x86_64.zip ```
I cant repro the behavior outside of `snap` it seems:
```
#include <stdio.h>
#include <glib.h>
#include <gio/gio.h>
void new_for_ uri(file_ uri); get_path( my_file) ;
g_object_ unref(my_ file);
print_type (const char* file_uri)
{
GFile* my_file = g_file_
char* path = g_file_
fprintf (stdout, "uri:%s => path:%s\n", file_uri, path);
}
int
"smb: //192.168. 1.36/documents/ Patches/ QPdfPresenterCo nsole-2. 7.0-Darwin- x86_64. zip", files)/ sizeof( files[0] );
print_ type(files[ f]);
main (void)
{
const char* files[] = {
};
int num_files = sizeof(
for(int f = 0; f < num_files; ++f) {
}
return 0;
}
```
build with
```
gcc gio-test-files.c `pkg-config --cflags --libs glib-2.0 --libs gio-2.0` -o gio-test-files
```
and running: //192.168. 1.36/documents/ Patches/ QPdfPresenterCo nsole-2. 7.0-Darwin- x86_64. zip => path:/run/ user/1000/ gvfs/smb- share:server= 192.168. 1.36,share= documents/ Patches/ QPdfPresenterCo nsole-2. 7.0-Darwin- x86_64. zip
```
$ ./gio-test-files
uri:smb:
```