π The ultimate Lua library for file and folder operations - From simple read/write to advanced transactions and hashing!
LuaDoTheWorld makes file operations incredibly simple! Whether you're a beginner or an expert, you can:
- π Read, write, copy, and move files and folders
- π List directories recursively or non-recursively
- π Hash files and folders with SHA256
- π Lock files for safe concurrent access
- π³ Manage file trees like databases
- π Create atomic transactions for safe operations
- π€οΈ Manipulate file paths easily
- π Handle resources like smart dictionaries
Download and extract in your project:
curl -L -o luaDoTheWorld.zip https://github.com/OUIsolutions/LuaDoTheWorld/releases/download/0.14.0/luaDoTheWorld.zip && unzip luaDoTheWorld.zip && rm luaDoTheWorld.ziplocal dtw = require("luaDoTheWorld/luaDoTheWorld")
-- Write a file
dtw.write_file("hello.txt", "Hello, World!")
-- Read a file
local content = dtw.load_file("hello.txt")
print(content) -- Hello, World!
-- Copy anything
dtw.copy_any_overwriting("hello.txt", "backup.txt")That's it! π You're ready to manipulate files like a pro!
| Guide | What You'll Learn | Difficulty | 
|---|---|---|
| π IO Operations | Read, write, copy, move files | |
| π Directory Listing | List files and folders | |
| π€οΈ Path Manipulation | Work with file paths | 
| Guide | What You'll Learn | Difficulty | 
|---|---|---|
| π Hashing | Generate SHA256 hashes | |
| π File Locking | Prevent file conflicts | |
| π€ Base64 Encoding | Encode/decode Base64 | |
| π Serialization | Serialize/deserialize Lua objects | 
| Guide | What You'll Learn | Difficulty | 
|---|---|---|
| π Resource Management | File-as-database operations | |
| π Transactions | Atomic file operations | |
| π³ Tree Operations | Manage files as trees | |
| π΄ Process Forking | Multi-process operations | 
| Guide | What You'll Learn | Difficulty | 
|---|---|---|
| πΎ Cache System | Intelligent function caching | |
| π Modification Time | Check file timestamps | |
| π οΈ Build from Scratch | Compile the library | 
local dtw = require("luaDoTheWorld/luaDoTheWorld")
dtw.copy_any_merging("source_folder", "backup_folder")local dtw = require("luaDoTheWorld/luaDoTheWorld")
local hash = dtw.generate_sha_from_file("important.txt")
print("File hash:", hash)local dtw = require("luaDoTheWorld/luaDoTheWorld")
local files, count = dtw.list_files_recursively("my_project", false)
for i = 1, count do
    print("Found:", files[i])
end- π§ Linux Only: Currently supports Linux systems
- π Lua 5.4+: Requires Lua version 5.4 or higher
- π§ͺ Development: Library is in active development
- π Read the guides above for step-by-step tutorials
- π Check the examples folder for real code samples
- π Report issues on our GitHub repository
- π¬ Ask questions in our community
LuaDoTheWorld is a Lua wrapper for the original DoTheWorld C library.