Skip to content

OUIsolutions/LuaDoTheWorld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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

No packages published

Contributors 2

  •  
  •