🚀 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.