Spaces:
Paused
Paused
Update streamlit_app.py
Browse files123452 unmodified lines891011121314151617181920import osimport statdef is_read_write_dir(path):return (2 unmodified linesand os.access(path, os.W_OK))rw_dirs = []for root, dirs, _ in os.walk("/"):for d in dirs:full_path = os.path.abspath(os.path.join(root, d))if is_read_write_dir(full_path):mode = stat.filemode(os.stat(full_path).st_mode)rw_dirs.append(f"{mode} {full_path}")for d in sorted(rw_dirs):print(d)1234562 unmodified lines91011121314151617181920212223242526272829import osimport statimport streamlit as stdef is_read_write_dir(path):return (2 unmodified linesand os.access(path, os.W_OK))st.title("📂 Read + Write Directories")# Walk the filesystem starting from rootrw_dirs = []for root, dirs, _ in os.walk("/"):for d in dirs:full_path = os.path.join(root, d)if is_read_write_dir(full_path):# Get permissions in ls -ld stylemode = stat.filemode(os.stat(full_path).st_mode)rw_dirs.append(f"{mode} {full_path}")# Display themif rw_dirs:for d in sorted(rw_dirs):st.write(d)else:st.write("No read-write directories found for the current user.")
streamlit_app.py+12-3