logo

utils-std

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

pathchk.1 (1481B)


  1. .\" utils-std: Collection of commonly available Unix tools
  2. .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. .\" SPDX-License-Identifier: MPL-2.0
  4. .Dd 2024-04-19
  5. .Dt PATHCHK 1
  6. .Os
  7. .Sh NAME
  8. .Nm pathchk
  9. .Nd check pathname validity
  10. .Sh SYNOPSIS
  11. .Nm
  12. .Op Fl pP
  13. .Ar pathname...
  14. .Sh DESCRIPTION
  15. .Nm
  16. checks each
  17. .Ar pathname
  18. for their validity and portability.
  19. .Pp
  20. By default,
  21. .Nm
  22. does the following checks, based on the underlying filesystem:
  23. .Bl -bullet
  24. .It
  25. Isn't longer than PATH_MAX
  26. .It
  27. Doesn't have any path component longer than NAME_MAX
  28. .It
  29. Is reachable to the current user
  30. .It
  31. Doesn't contains invalid bytes
  32. .El
  33. .Pp
  34. Note that non-existing path components aren't seen as an error by
  35. .Nm .
  36. .Sh OPTIONS
  37. .Bl -tag -width ee
  38. .It Fl p
  39. Do not perform checks against the underlying filesystem, meaning:
  40. .Bl -bullet -compact
  41. .It
  42. _POSIX_PATH_MAX is used instead of PATH_MAX
  43. .It
  44. _POSIX_NAME_MAX is used instead of NAME_MAX
  45. .It
  46. Directories aren't checked for user reachability
  47. .It
  48. POSIX Portable Character Set is the only reference for invalid byte sequences
  49. .El
  50. .It Fl P
  51. Perform the following additional checks:
  52. .Bl -bullet -compact
  53. .It
  54. Doesn't contains a path component whose first character is the <hyphen-minus> character
  55. .It
  56. Isn't empty
  57. .El
  58. .El
  59. .Sh EXIT STATUS
  60. .Ex -std
  61. .Sh SEE ALSO
  62. .Xr test 1
  63. .Sh STANDARDS
  64. .Nm
  65. should be compliant with
  66. IEEE Std 1003.1-2024 (“POSIX.1”)
  67. specification.
  68. .Sh AUTHORS
  69. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me