SAL OS Package (sal-os)
The sal-os package provides a comprehensive suite of operating system interaction utilities. It offers a cross-platform abstraction layer for common OS-level tasks, simplifying system programming in Rust.
Features
- File System Operations: Comprehensive file and directory manipulation
- Download Utilities: File downloading with automatic extraction support
- Package Management: System package manager integration
- Platform Detection: Cross-platform OS and architecture detection
- Rhai Integration: Full scripting support for all OS operations
Modules
fs: File system operations (create, copy, delete, find, etc.)download: File downloading and basic installationpackage: System package managementplatform: Platform and architecture detection
Usage
Add this to your Cargo.toml:
[]
= "0.1.0"
File System Operations
use fs;
Download Operations
use download;
Platform Detection
use platform;
Rhai Integration
The package provides full Rhai scripting support:
// File operations
mkdir("test_dir");
file_write("test_dir/hello.txt", "Hello World!");
let content = file_read("test_dir/hello.txt");
// Download operations
download("https://example.com/file.zip", "/tmp", 0);
chmod_exec("/tmp/script.sh");
// Platform detection
if is_linux() {
print("Running on Linux");
}