๐ŸŒ LuaDoTheWorld

August 21, 2025 ยท View on GitHub

Lua Platform Version License

๐Ÿš€ The ultimate Lua library for file and folder operations - From simple read/write to advanced transactions and hashing!


โœจ What Can You Do?

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

๐Ÿš€ Quick Start

1๏ธโƒฃ Install LuaDoTheWorld

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

2๏ธโƒฃ Use in Your Code

local 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!


๐Ÿ“š Complete Documentation

๐ŸŽฏ Core Operations

GuideWhat You'll LearnDifficulty
๐Ÿ“‚ IO OperationsRead, write, copy, move filesBeginner
๐Ÿ“‹ Directory ListingList files and foldersBeginner
๐Ÿ›ค๏ธ Path ManipulationWork with file pathsBeginner

๐Ÿ”’ Security & Hashing

GuideWhat You'll LearnDifficulty
๐Ÿ”‘ HashingGenerate SHA256 hashesBeginner
๐Ÿ”’ File LockingPrevent file conflictsBeginner
๐Ÿ”ค Base64 EncodingEncode/decode Base64Beginner
๐Ÿ”„ SerializationSerialize/deserialize Lua objectsBeginner

๐Ÿš€ Advanced Features

GuideWhat You'll LearnDifficulty
๐Ÿ“ Resource ManagementFile-as-database operationsIntermediate
๐Ÿ”„ TransactionsAtomic file operationsIntermediate
๐ŸŒณ Tree OperationsManage files as treesIntermediate
๐Ÿด Process ForkingMulti-process operationsAdvanced

๐Ÿ› ๏ธ Utilities

GuideWhat You'll LearnDifficulty
๐Ÿ’พ Cache SystemIntelligent function cachingBeginner
๐Ÿ•’ Modification TimeCheck file timestampsBeginner
๐Ÿ› ๏ธ Build from ScratchCompile the libraryBeginner

๐Ÿ’ก Quick Examples

Copy Files Safely

local dtw = require("luaDoTheWorld/luaDoTheWorld")
dtw.copy_any_merging("source_folder", "backup_folder")

Generate File Hash

local dtw = require("luaDoTheWorld/luaDoTheWorld")
local hash = dtw.generate_sha_from_file("important.txt")
print("File hash:", hash)

List All Files Recursively

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

โš ๏ธ Important Notes

  • ๐Ÿง Linux Only: Currently supports Linux systems
  • ๐ŸŒ™ Lua 5.4+: Requires Lua version 5.4 or higher
  • ๐Ÿงช Development: Library is in active development

๐Ÿ†˜ Need Help?

  • ๐Ÿ“– 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

๐Ÿ™ Credits

LuaDoTheWorld is a Lua wrapper for the original DoTheWorld C library.


Happy Coding

Made with โค๏ธ for the Lua community