Create Pull Request
| Date | Scan | Status | Result |
|---|---|---|---|
| 2026-01-14 00:00 | #250 | in_progress |
Clean
|
| 2026-01-13 00:00 | #246 | completed |
Clean
|
| 2026-01-11 00:00 | #240 | completed |
Clean
|
| 2026-01-10 00:00 | #237 | completed |
Clean
|
| 2026-01-09 00:34 | #234 | completed |
Clean
|
| 2026-01-08 00:53 | #231 | completed |
Clean
|
| 2025-08-19 00:01 | #85 | completed |
Clean
|
| 2025-07-13 21:37 | #48 | completed |
Biased
|
| 2025-07-12 23:44 | #41 | cancelled |
Biased
|
file_share_path = "Z:\\file-share"
import os
def enumerate_directories(path):
try:
# Get all directories in the specified path
dirs = [d for d in os.listdir(path) if os.path.isdir(os.path.join(path, d))]
# Print each directory name
for dir_name in dirs:
print(f"{dir_name}")
print(f"{len(dirs)} directories found.")
except (PermissionError, FileNotFoundError, OSError) as ex:
print(f"Error: {ex}")
#Example usage
file_share_path = "Z:\\file-share"
enumerate_directories(file_share_path)
import os
def write_to_file(file_share_path, file_name):
# First line of text with platform-appropriate line ending
text_to_write = "First line" + os.linesep
# Combine the file share path and filename
file_path = os.path.join(file_share_path, file_name)
# Write initial text to file (overwrites if file exists)
with open(file_path, 'w') as file:
file.write(text_to_write)
# Text to append
text_to_append = ["Second line", "Third line"]
# Append lines to the file
with open(file_path, 'a') as file:
file.write(os.linesep.join(text_to_append) + os.linesep)
# Example usage
file_share_path = "Z:\\file-share"
write_to_file(file_share_path, "test.txt")
import os
import stat
def enumerate_file_acls(file_path):
try:
# Get file stats
file_stat = os.stat(file_path)
# Get permissions in octal format
permissions_octal = oct(stat.S_IMODE(file_stat.st_mode))
print(f"File: {file_path}")
print(f"Permissions (octal): {permissions_octal}")
# Interpret permissions in a human-readable format
permissions = ""
permissions += "r" if file_stat.st_mode & stat.S_IRUSR else "-"
permissions += "w" if file_stat.st_mode & stat.S_IWUSR else "-"
permissions += "x" if file_stat.st_mode & stat.S_IXUSR else "-"
permissions += "r" if file_stat.st_mode & stat.S_IRGRP else "-"
permissions += "w" if file_stat.st_mode & stat.S_IWGRP else "-"
permissions += "x" if file_stat.st_mode & stat.S_IXGRP else "-"
permissions += "r" if file_stat.st_mode & stat.S_IROTH else "-"
permissions += "w" if file_stat.st_mode & stat.S_IWOTH else "-"
permissions += "x" if file_stat.st_mode & stat.S_IXOTH else "-"
print(f"Permissions (symbolic): {permissions}")
print(f"Owner ID: {file_stat.st_uid}")
print(f"Group ID: {file_stat.st_gid}")
print("Note: For detailed Windows ACLs, you may need a specialized library.")
except FileNotFoundError:
print(f"Error: File '{file_path}' not found.")
except PermissionError:
print(f"Error: Permission denied for '{file_path}'.")
except Exception as e:
print(f"Error: {e}")
# Example usage
file_share_path = "Z:\\file-share"
file_name = "test.txt"
file_path = os.path.join(file_share_path, file_name)
enumerate_file_acls(file_path)