Skip to content

OUIsolutions/LuaDoTheWorld

Repository files navigation

🌍 LuaDoTheWorld

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

Guide What You'll Learn Difficulty
📂 IO Operations Read, write, copy, move files Beginner
📋 Directory Listing List files and folders Beginner
🛤️ Path Manipulation Work with file paths Beginner

🔒 Security & Hashing

Guide What You'll Learn Difficulty
🔑 Hashing Generate SHA256 hashes Beginner
🔒 File Locking Prevent file conflicts Beginner
🔤 Base64 Encoding Encode/decode Base64 Beginner
🔄 Serialization Serialize/deserialize Lua objects Beginner

🚀 Advanced Features

Guide What You'll Learn Difficulty
📁 Resource Management File-as-database operations Intermediate
🔄 Transactions Atomic file operations Intermediate
🌳 Tree Operations Manage files as trees Intermediate
🍴 Process Forking Multi-process operations Advanced

🛠️ Utilities

Guide What You'll Learn Difficulty
💾 Cache System Intelligent function caching Beginner
🕒 Modification Time Check file timestamps Beginner
🛠️ Build from Scratch Compile the library Beginner

💡 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

About

A Lua port of the doTheWorld Lib

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors