All Projects β†’ cxong β†’ Tinydir

cxong / Tinydir

Licence: other
Lightweight, portable and easy to integrate C directory and file reader

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Tinydir

onionjuggler
Manage your Onion Services via CLI or TUI on Unix-like operating system with a POSIX compliant shell.
Stars: ✭ 31 (-94.61%)
Mutual labels:  portable, posix
fusell-seed
FUSE (the low-level interface) file system boilerplate πŸ“‚ πŸ”Œ πŸ’Ύ
Stars: ✭ 13 (-97.74%)
Mutual labels:  filesystem, posix
cubefs
CubeFS is a cloud native distributed storage platform.
Stars: ✭ 3,062 (+432.52%)
Mutual labels:  filesystem, posix
Fdir
⚑ The fastest directory crawler & globbing library for NodeJS. Crawls 1m files in < 1s
Stars: ✭ 777 (+35.13%)
Mutual labels:  directory, filesystem
Python Atomicwrites
Powerful Python library for atomic file writes.
Stars: ✭ 253 (-56%)
Mutual labels:  filesystem, posix
gtree
Output tree🌳 or Make directoriesπŸ“ from #Markdown or Programmatically. Provide CLI, Golang library and Web (using #Wasm ).
Stars: ✭ 88 (-84.7%)
Mutual labels:  filesystem, directory
fsify
Convert an array of objects into a persistent or temporary directory structure.
Stars: ✭ 24 (-95.83%)
Mutual labels:  filesystem, directory
Fusell Seed
FUSE (the low-level interface) file system boilerplate πŸ“‚ πŸ”Œ πŸ’Ύ
Stars: ✭ 9 (-98.43%)
Mutual labels:  filesystem, posix
files
Useful methods to manage files and directories
Stars: ✭ 27 (-95.3%)
Mutual labels:  filesystem, directory
tonix
Tonix provides basic file system functionality, as well as an interactive shell with a Unix-style command line interface.
Stars: ✭ 20 (-96.52%)
Mutual labels:  filesystem, posix
Chubaofs
ChubaoFS (abbrev. CBFS) is a cloud native distributed file system and object store.
Stars: ✭ 2,482 (+331.65%)
Mutual labels:  filesystem, posix
Goofys
a high-performance, POSIX-ish Amazon S3 file system written in Go
Stars: ✭ 3,932 (+583.83%)
Mutual labels:  filesystem, posix
Nohost
A web server in your web browser
Stars: ✭ 164 (-71.48%)
Mutual labels:  filesystem, posix
lustre-release
Mirror of official Lustre development repository http://git.whamcloud.com/
Stars: ✭ 35 (-93.91%)
Mutual labels:  filesystem, posix
Moosefs
MooseFS – Open Source, Petabyte, Fault-Tolerant, Highly Performing, Scalable Network Distributed File System (Software-Defined Storage)
Stars: ✭ 1,025 (+78.26%)
Mutual labels:  filesystem, posix
juicefs-csi-driver
JuiceFS CSI Driver
Stars: ✭ 117 (-79.65%)
Mutual labels:  filesystem, posix
Stdex
std C++ 11 library impementation with extra features using only C++ 98 and POSIX threads
Stars: ✭ 43 (-92.52%)
Mutual labels:  posix, portable
Zenroom
Small, secure and portable virtual machine for crypto language processing
Stars: ✭ 96 (-83.3%)
Mutual labels:  posix, portable
dotfiles
Portable configuration files and utility scripts for Linux and OpenBSD
Stars: ✭ 29 (-94.96%)
Mutual labels:  portable, posix
Juicefs
JuiceFS is a distributed POSIX file system built on top of Redis and S3.
Stars: ✭ 4,262 (+641.22%)
Mutual labels:  filesystem, posix

TinyDir

Build Status Release

Lightweight, portable and easy to integrate C directory and file reader. TinyDir wraps dirent for POSIX and FindFirstFile for Windows.

Windows unicode is supported by defining UNICODE and _UNICODE before including tinydir.h.

Example

There are two methods. Error checking omitted:

tinydir_dir dir;
tinydir_open(&dir, "/path/to/dir");

while (dir.has_next)
{
	tinydir_file file;
	tinydir_readfile(&dir, &file);

	printf("%s", file.name);
	if (file.is_dir)
	{
		printf("/");
	}
	printf("\n");

	tinydir_next(&dir);
}

tinydir_close(&dir);
tinydir_dir dir;
int i;
tinydir_open_sorted(&dir, "/path/to/dir");

for (i = 0; i < dir.n_files; i++)
{
	tinydir_file file;
	tinydir_readfile_n(&dir, &file, i);

	printf("%s", file.name);
	if (file.is_dir)
	{
		printf("/");
	}
	printf("\n");
}

tinydir_close(&dir);

See the /samples folder for more examples, including an interactive command-line directory navigator.

Language

ANSI C, or C90.

Platforms

POSIX and Windows supported. Open to the possibility of supporting other platforms.

License

Simplified BSD; if you use tinydir you can comply by including tinydir.h or COPYING somewhere in your package.

Known Limitations

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].