Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cxong/tinydir.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCong <c_xong@hotmail.com>2013-02-03 12:51:33 +0400
committerCong <c_xong@hotmail.com>2013-02-03 12:51:33 +0400
commitbd983029faf0c9a7b28b640d71a6c12726082005 (patch)
treea5d2968e8347c730f8627a9eee39d467c7c2ad4d /README.md
parentd02ba6702b2c0c75a22124ddfa7c79b0056f15cf (diff)
Add interactive subdirectory open example; other fixes
Rename source files Add sorted example to README.md Fix sorting to be case insensitive
Diffstat (limited to 'README.md')
-rw-r--r--README.md29
1 files changed, 25 insertions, 4 deletions
diff --git a/README.md b/README.md
index 4462b3c..9b0063d 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ Lightweight, portable and easy to integrate C directory and file reader.
Example
=======
-Error checking omitted:
+There are two methods. Error checking omitted:
```C
tinydir_dir dir;
@@ -30,6 +30,27 @@ while (dir.has_next)
tinydir_close(&dir);
```
+```C
+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);
+```
+
Language
========
@@ -48,6 +69,6 @@ BSD.
Known Limitations
=================
-Not threadsafe
-Limited path and filename sizes
-No wide char support
+- Not threadsafe
+- Limited path and filename sizes
+- No wide char support