safe_filename

Contents

safe_filename#

ptyrad.utils.common.safe_filename(filepath, verbose=False)[source]#

Ensures a filepath is safe across platforms by: 1. Converting relative paths to absolute 2. Limiting individual components to 255 characters 3. Handling total path length restrictions 4. Providing feedback when corrections are made

Parameters:
  • filepath – The original filepath to make safe

  • verbose – Whether to print messages about corrections (default: False)

Returns:

A modified filepath that should work across platforms