1
0
Fork 0

Merge /u/jsb1685/fgdata/ branch next into next

https://sourceforge.net/p/flightgear/fgdata/merge-requests/161/
This commit is contained in:
James Turner 2019-11-11 09:32:13 +00:00
commit a83b64b689

View file

@ -22,6 +22,27 @@ var dirname = func(path) {
substr(path, 0, size(path) - size(basename(path)));
};
var is_directory = func(path) {
var tmp = stat(path);
if (tmp != nil and tmp[11] == "dir") return 1;
else return 0;
};
# <path> the path that should be searched for subdirectories
# returns a vector of subdirectory names
var subdirectories = func(path) {
if (!is_directory(path))
return;
var list = subvec(directory(path), 2);
var subdirs = [];
foreach (var entry; list) {
if (is_directory(path~"/"~entry)) {
append(subdirs, entry);
}
}
return subdirs;
}
# include(<filename>)
#
# Loads and executes a Nasal file in place. The file is searched for in the