// This program takes a list of files and directories (indicated by a // trailing slash) on the stdin, and prints to stdout each input // filename along with its desired uid, gid, and mode (in octal). // The leading slash should be stripped from the input. // // After the first 4 columns, optional key=value pairs are emitted // for each file. Currently, the following keys are supported: // // -C: capabilities=[hex capabilities value] // // Example input: // // system/etc/dbus.conf // data/app/ // // Output: // // system/etc/dbus.conf 1002 1002 440 // data/app 1000 1000 771 // // Note that the output will omit the trailing slash from // directories.
if (root_path != NULL) {
size_t root_len = strlen(root_path); /* Trim any trailing slashes from the root path. */ while (root_len && root_path[--root_len] == '/') {
root_path[root_len] = '\0';
}
}
while (fgets(buffer, 1023, stdin) != NULL) { int is_dir = 0; int i; for (i = 0; i < 1024 && buffer[i]; ++i) { switch (buffer[i]) { case'\n':
buffer[i-is_dir] = '\0'; if (i == 0) {
is_dir = 1; // empty line is considered as root directory
}
i = 1025; break; case'/':
is_dir = 1; break; default:
is_dir = 0; break;
}
}
unsigned uid = 0, gid = 0, mode = 0;
uint64_t capabilities;
fs_config(buffer, is_dir, product_out_path, &uid, &gid, &mode, &capabilities); if (root_path != NULL && strcmp(buffer, root_path) == 0) { /* The root of the filesystem needs to be an empty string. */
strcpy(buffer, "");
}
printf("%s %d %d %o", buffer, uid, gid, mode);
if (print_capabilities) {
printf(" capabilities=0x%" PRIx64, capabilities);
}
printf("\n");
} return0;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.