Spaces:
Runtime error
Runtime error
Update read_storage.py
Browse files- read_storage.py +9 -20
read_storage.py
CHANGED
|
@@ -1,22 +1,11 @@
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
for root, dirs, files in os.walk(
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
print(
|
| 12 |
-
|
| 13 |
-
print("\n=== FILE CONTENTS ===")
|
| 14 |
-
for root, dirs, files in os.walk(STORAGE_PATH):
|
| 15 |
-
for file in files:
|
| 16 |
-
path = os.path.join(root, file)
|
| 17 |
-
print(f"\n===== FILE: {path} =====")
|
| 18 |
-
try:
|
| 19 |
-
with open(path, "r", encoding="utf-8", errors="ignore") as fh:
|
| 20 |
-
print(fh.read())
|
| 21 |
-
except Exception as e:
|
| 22 |
-
print(f"[ERROR] {e}")
|
|
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
+
for base in ["/data", "/app", "/home", "/tmp", "/"]:
|
| 4 |
+
print(f"\n=== CHECK {base} ===")
|
| 5 |
+
try:
|
| 6 |
+
for root, dirs, files in os.walk(base):
|
| 7 |
+
for name in files[:5]:
|
| 8 |
+
print(os.path.join(root, name))
|
| 9 |
+
break
|
| 10 |
+
except:
|
| 11 |
+
print("cannot access")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|