Observed since 20 Oct, 17:58 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A tool that retrieves and displays file or directory access information In Linux and Windows
Access Watch is a Python script designed to retrieve and display file access information, such as last access time and file ownership details, on both Linux and Windows systems. The script utilizes OS-specific modules to gather this information, making it versatile and suitable for cross-platform environments.
The LinuxAccessWatch class is designed to monitor and retrieve file information related to user access in a Linux environment. It provides methods to obtain metadata such as the last access time, owner UID, owner GID, owner username, and owner group name of a specified file or directory.
get_file_stats() -> None: Gathers file statistics including last access time, owner UID, and owner GID.get_owner_uid() -> Optional[int]: Retrieves the user ID (UID) of the file owner.get_owner_gid() -> Optional[int]: Retrieves the group ID (GID) of the file owner.uid_to_username() -> str: Converts the owner UID to a human-readable username.gid_to_groupname() -> str: Converts the owner GID to a human-readable group name.get_last_access_time() -> Optional[str]: Returns the last access time of the file in a human-readable format.get_username() -> str: Retrieves the username of the file owner.get_groupname() -> str: Retrieves the group name of the file owner.from accesswatch.linux import LinuxAccessWatch
access_watch = LinuxAccessWatch("/path/to/file_or/directory")
last_access_time = access_watch.get_last_access_time()
# Sat Sep 21 10:48:05 2024
owner_uid = access_watch.get_owner_uid()
# id
owner_gid = access_watch.get_owner_gid()
# id
username = access_watch.get_username()
# username
groupname = access_watch.get_groupname()
# usergroup
WindowsAccessWatch is a class designed to monitor and retrieve information about file access on Windows systems. It tracks the last access time of a file, retrieves the owner Security Identifier (SID), and converts this SID into a human-readable account name, domain name, and account type.
__init__(file_path): Initializes the WindowsAccessWatch object with the file path and retrieves the owner SID.set_owner_sid(): Sets the owner SID for the specified file or directory.get_file_stats(): Retrieves the last access time and owner SID of the file.get_last_access_time(): Returns the last access time in a human-readable format.get_owner_sid(): Returns the owner SID of the file.get_owner_sid_string(): Returns the owner SID as a string in a human-readable format.sid_to_username_info(sid): Converts a given SID to a username, domain name, and account type.user_access_info(): Retrieves the account name, domain name, and account type for the file owner.from accesswatch.windows import WindowsAccessWatch
access_watcher = WindowsAccessWatch("/path/to/file_or/directory")
last_access_time = access_watcher.get_last_access_time()
owner_sid = access_watcher.get_owner_sid_string()
account_name, domain_name, account_type = access_watcher.user_access_info()
Contributions are welcome!
Github: https://github.com/mahdikhoshdel/accesswatch.git
Please follow these steps:
git checkout -b feature-branch).git commit -m 'Add some feature').git push origin feature-branch).This project is licensed under the MIT License.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.3 | 4 Oct 2024 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 17:58 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:f984bdc62eeb4bf3b049782533834d509333897f236f4b62b0b631dc52305f2c