【发布时间】:2021-05-08 19:12:14
【问题描述】:
我想将文件添加到列表中,然后在 for 循环中访问它们。我就是这样做的:
private get_app_list () {
var file = new File.new_for_path (/usr/share/applications);
List<File> app_list = new List<File> ();
foreach (File desktop_file in app_list) {
// other code here
}
}
访问存储在目录中的文件然后将它们添加到列表中的正确方法是什么??
【问题讨论】: