

This feels like a very US-specific way of framing it. In the UK and much of Europe, many of those “societal-level solutions” already exist to varying degrees: healthcare and mental healthcare free at the point of use, unemployment support, benefits towards rent, social and temporary housing, legal homelessness-prevention duties, and Housing First programmes.
They’re nowhere near perfect. We have social-housing shortages, benefit limits, long healthcare waiting lists and plenty of people who still fall through the gaps. But the response doesn’t have to begin and end with moving homeless people somewhere less visible to protect property values.
Your point that individual businesses and property owners cannot solve homelessness is completely fair. That’s precisely why they should sit behind a publicly funded safety net which helps keep people housed and supports them back into stability, instead of leaving everyone involved to deal with the consequences.
This might go beyond what you were asking for, but I’m always more comfortable handling file paths, deletions and errors in Python.
#!/usr/bin/env python3 import shutil from pathlib import Path from tempfile import TemporaryDirectory # Refuse to run without Python's symlink-resistant cleanup. if not getattr(shutil.rmtree, "avoids_symlink_attacks", False): raise RuntimeError("Symlink-resistant cleanup is unavailable") with TemporaryDirectory(prefix="test-run-", dir="/tmp") as name: tests = Path(name) / "tests" tests.mkdir(mode=0o700) print(f"Created {str(tests)!r}", flush=True) try: # Put your test code here. (tests / "example.txt").write_text( "temporary data\n", encoding="utf-8" ) finally: print(f"Cleaning {name!r}", flush=True) # The entire temporary directory has now been removed.