logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git

mode.h (465B)


  1. // Collection of Unix tools, comparable to coreutils
  2. // SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. // SPDX-License-Identifier: MPL-2.0
  4. #include <sys/stat.h> // mode_t
  5. // Returns 0 on error and sets errstr
  6. mode_t new_mode(const char *mode, mode_t old, const char **errstr);
  7. // Octal file mode in `mode`, symbolic version in `str`
  8. // Example: mode=040755 ; str="drwxr-xr-x"
  9. void symbolize_mode(mode_t mode, char str[11]);