Galaxie Shell 0.2.6 documentation


Navigation:   | Index   | Search   | Top   | Up   | Prev   | Next   |
Table of Content: |glxshell.lib.symbolic_mode module |symbolic_mode() |

© Copyright 2020-2024, Galaxie Shell Team.

Top » glxshell » glxshell package » glxshell.lib package » glxshell.lib.symbolic_mode module

glxshell.lib.symbolic_mode module

glxshell.lib.symbolic_mode.symbolic_mode(symbolic, mode=None, isdir=0, umask=0)[source]

Convert a symbolic mode string into a mode.

Examples:

symbolic_mode(“u+w”, mode=0444) == 0644 symbolic_mode(“=x”, mode=0444, umask=0700) == 0411 symbolic_mode(“og-rxw”, mode=0777) == 0700 symbolic_mode(“o-rxw,g-rxw”, mode=0777) == 0700 symbolic_mode(“a=rx,u+w”) == 0755 symbolic_mode(“og+X”, mode=0644, isdir=0) == 0644 symbolic_mode(“og+X”, mode=0644, isdir=1) == 0655

For more detailed information, consult your local man page for chmod.

Parameters:
  • symbolic (str) – the symbilic mode representation

  • mode (oct) – needed because some operation add, copy or remove bits from the old mode. If no mode is given, the default is 0755.

  • isdir (int) – the X permission acts differently on files than on directories. A true value indicates this should be treated like a directory. The default is 0, which indicates a file.

  • umask (oct) – used when no users are given in the mode string. The default value is 0.

Returns:

mode

Return type:

oct

Top » glxshell » glxshell package » glxshell.lib package » glxshell.lib.symbolic_mode module

© Copyright 2020-2024, Galaxie Shell Team.
This page is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License (CC BY-NC-SA 4.0).
Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
See History and License for more information.

Last updated on None.
Created using Sphinx 8.0.2.