0
How can I return in a GTK function in C a list of characters with GSList?
I need to save the path of each file contained in a folder This is my code: void on_file1_file_set(GtkFileChooserButton *chooser){ GSList filelist; printf("file name = %s\n", gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(chooser))); printf("folder uri = %s\n", gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(chooser))); printf("folder filenames = %s\n", gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(chooser))); return filelist; }
1 ответ
0
To do that you can follow these steps:
- Create an empty GSList.
- Iterate through the files in the folder.
- For each file, append its path to the GSList.
- Return the GSList containing the file paths.