diff --git a/src/apps/httpd/makefsdata/makefsdata b/src/apps/httpd/makefsdata/makefsdata
old mode 100644
new mode 100755
index 37b4203..0e2bf72
Binary files a/src/apps/httpd/makefsdata/makefsdata and b/src/apps/httpd/makefsdata/makefsdata differ
diff --git a/src/apps/httpd/makefsdata/makefsdata.c b/src/apps/httpd/makefsdata/makefsdata.c
index d9bfe4a..b837e30 100644
--- a/src/apps/httpd/makefsdata/makefsdata.c
+++ b/src/apps/httpd/makefsdata/makefsdata.c
@@ -13,17 +13,12 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include "windows.h"
-#else
-#include <dir.h>
-#endif
-#include <dos.h>
 #include <string.h>
 #include <time.h>
 #include <sys/stat.h>
 
+#include "tinydir.h"
+
 /** Makefsdata can generate *all* files deflate-compressed (where file size shrinks).
  * Since nearly all browsers support this, this is a good way to reduce ROM size.
  * To compress the files, "miniz.c" must be downloaded seperately.
@@ -65,41 +60,26 @@ int deflate_level = 10; /* default compression level, can be changed via command
 #define USAGE_ARG_DEFLATE ""
 #endif /* MAKEFS_SUPPORT_DEFLATE */
 
-/* Compatibility defines Win32 vs. DOS */
 #ifdef WIN32
 
-#define FIND_T                        WIN32_FIND_DATAA
-#define FIND_T_FILENAME(fInfo)        (fInfo.cFileName)
-#define FIND_T_IS_DIR(fInfo)          ((fInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0)
-#define FIND_T_IS_FILE(fInfo)         ((fInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
-#define FIND_RET_T                    HANDLE
-#define FINDFIRST_FILE(path, result)  FindFirstFileA(path, result)
-#define FINDFIRST_DIR(path, result)   FindFirstFileA(path, result)
-#define FINDNEXT(ff_res, result)      FindNextFileA(ff_res, result)
-#define FINDFIRST_SUCCEEDED(ret)      (ret != INVALID_HANDLE_VALUE)
-#define FINDNEXT_SUCCEEDED(ret)       (ret == TRUE)
+#warning win32
 
 #define GETCWD(path, len)             GetCurrentDirectoryA(len, path)
 #define CHDIR(path)                   SetCurrentDirectoryA(path)
 #define CHDIR_SUCCEEDED(ret)          (ret == TRUE)
 
-#else
+#elif __linux__
 
-#define FIND_T                        struct ffblk
-#define FIND_T_FILENAME(fInfo)        (fInfo.ff_name)
-#define FIND_T_IS_DIR(fInfo)          ((fInfo.ff_attrib & FA_DIREC) == FA_DIREC)
-#define FIND_T_IS_FILE(fInfo)         (1)
-#define FIND_RET_T                    int
-#define FINDFIRST_FILE(path, result)  findfirst(path, result, FA_ARCH)
-#define FINDFIRST_DIR(path, result)   findfirst(path, result, FA_DIREC)
-#define FINDNEXT(ff_res, result)      FindNextFileA(ff_res, result)
-#define FINDFIRST_SUCCEEDED(ret)      (ret == 0)
-#define FINDNEXT_SUCCEEDED(ret)       (ret == 0)
+#warning linux
 
 #define GETCWD(path, len)             getcwd(path, len)
 #define CHDIR(path)                   chdir(path)
 #define CHDIR_SUCCEEDED(ret)          (ret == 0)
 
+#else
+
+#error makefsdata not supported on this platform
+
 #endif
 
 #define NEWLINE     "\r\n"
@@ -426,56 +406,83 @@ void concat_files(const char *file1, const char *file2, const char *targetfile)
 
 int process_sub(FILE *data_file, FILE *struct_file)
 {
-  FIND_T fInfo;
-  FIND_RET_T fret;
+  tinydir_dir dir;
   int filesProcessed = 0;
 
   if (processSubs) {
     /* process subs recursively */
     size_t sublen = strlen(curSubdir);
     size_t freelen = sizeof(curSubdir) - sublen - 1;
+    int ret;
     LWIP_ASSERT("sublen < sizeof(curSubdir)", sublen < sizeof(curSubdir));
-    fret = FINDFIRST_DIR("*", &fInfo);
-    if (FINDFIRST_SUCCEEDED(fret)) {
-      do {
-        const char *curName = FIND_T_FILENAME(fInfo);
-        if ((curName[0] == '.') || (strcmp(curName, "CVS") == 0)) {
-          continue;
-        }
-        if (!FIND_T_IS_DIR(fInfo)) {
-          continue;
-        }
-        if (freelen > 0) {
-           CHDIR(curName);
-           strncat(curSubdir, "/", freelen);
-           strncat(curSubdir, curName, freelen - 1);
-           curSubdir[sizeof(curSubdir) - 1] = 0;
-           printf("processing subdirectory %s/..." NEWLINE, curSubdir);
-           filesProcessed += process_sub(data_file, struct_file);
-           CHDIR("..");
-           curSubdir[sublen] = 0;
-        } else {
-           printf("WARNING: cannot process sub due to path length restrictions: \"%s/%s\"\n", curSubdir, curName);
+
+    ret = tinydir_open_sorted(&dir, ".");
+
+    if (ret == 0) {
+      unsigned int i;
+      for (i = 0; i < dir.n_files; i++) {
+        tinydir_file file;
+
+        ret = tinydir_readfile_n(&dir, &file, i);
+
+        if (ret == 0) {
+          const char *currName = file.name;
+
+          if (currName[0] == '.') {
+            continue;
+          }
+          if (!file.is_dir) {
+            continue;
+          }
+          if (freelen > 0) {
+            CHDIR(currName);
+            strncat(curSubdir, "/", freelen);
+            strncat(curSubdir, currName, freelen - 1);
+            curSubdir[sizeof(curSubdir) - 1] = 0;
+            printf("processing subdirectory %s/..." NEWLINE, curSubdir);
+            filesProcessed += process_sub(data_file, struct_file);
+            CHDIR("..");
+            curSubdir[sublen] = 0;
+          } 
+          else {
+            printf("WARNING: cannot process sub due to path length restrictions: \"%s/%s\"\n", curSubdir, currName);
+          }
         }
-      } while (FINDNEXT_SUCCEEDED(FINDNEXT(fret, &fInfo)));
+      }
     }
-  }
 
-  fret = FINDFIRST_FILE("*.*", &fInfo);
-  if (FINDFIRST_SUCCEEDED(fret)) {
-    /* at least one file in directory */
-    do {
-      if (FIND_T_IS_FILE(fInfo)) {
-        const char *curName = FIND_T_FILENAME(fInfo);
-        printf("processing %s/%s..." NEWLINE, curSubdir, curName);
-        if (process_file(data_file, struct_file, curName) < 0) {
-          printf(NEWLINE "Error... aborting" NEWLINE);
-          return -1;
+    ret = tinydir_open_sorted(&dir, ".");
+    if (ret == 0) {
+      unsigned int i;
+      for (i = 0; i < dir.n_files; i++) {
+        tinydir_file file;
+
+        ret = tinydir_readfile_n(&dir, &file, i);
+
+        if (ret == 0) {
+          if (!file.is_dir) {
+            const char *curName = file.name;
+
+            if (strcmp(curName, "fsdata.tmp") == 0) {
+              continue;
+            }
+            if (strcmp(curName, "fshdr.tmp") == 0) {
+              continue;
+            }
+
+            printf("processing %s/%s..." NEWLINE, curSubdir, curName);
+
+            if (process_file(data_file, struct_file, curName) < 0) {
+              printf(NEWLINE "Error... aborting" NEWLINE);
+              return -1;
+            }
+            filesProcessed++;
+          }
         }
-        filesProcessed++;
       }
-    } while (FINDNEXT_SUCCEEDED(FINDNEXT(fret, &fInfo)));
+    }
   }
+
   return filesProcessed;
 }
 
@@ -583,7 +590,7 @@ void process_file_data(FILE* data_file, u8_t* file_data, size_t file_size)
   size_t off = 0;
   for (i = 0; i < file_size; i++) {
     LWIP_ASSERT("file_buffer_c overflow", off < sizeof(file_buffer_c) - 5);
-    sprintf(&file_buffer_c[off], "0x%02.2x,", file_data[i]);
+    sprintf(&file_buffer_c[off], "0x%02x,", file_data[i]);
     off += 5;
     if ((++src_off % HEX_BYTES_PER_LINE) == 0) {
       LWIP_ASSERT("file_buffer_c overflow", off < sizeof(file_buffer_c) - NEWLINE_LEN);
@@ -746,7 +753,7 @@ int process_file(FILE *data_file, FILE *struct_file, const char *filename)
 #if ALIGN_PAYLOAD
   /* pad to even number of bytes to assure payload is on aligned boundary */
   while(i % PAYLOAD_ALIGNMENT != 0) {
-    fprintf(data_file, "0x%02.2x,", 0);
+    fprintf(data_file, "0x%02x,", 0);
     i++;
   }
 #endif /* ALIGN_PAYLOAD */
@@ -902,7 +909,7 @@ int file_write_http_header(FILE *data_file, const char *filename, int file_size,
       hdr_len += cur_len;
     }
 
-    _itoa(content_len, intbuf, 10);
+    lwip_itoa(intbuf, content_len, 10);
     strcat(intbuf, "\r\n");
     cur_len = strlen(intbuf);
     written += file_put_ascii(data_file, intbuf, cur_len, &i);
@@ -1010,7 +1017,7 @@ int file_put_ascii(FILE *file, const char* ascii_string, int len, int *i)
   int x;
   for (x = 0; x < len; x++) {
     unsigned char cur = ascii_string[x];
-    fprintf(file, "0x%02.2x,", cur);
+    fprintf(file, "0x%02x,", cur);
     if ((++(*i) % HEX_BYTES_PER_LINE) == 0) {
       fprintf(file, NEWLINE);
     }
@@ -1024,7 +1031,7 @@ int s_put_ascii(char *buf, const char *ascii_string, int len, int *i)
   int idx = 0;
   for (x = 0; x < len; x++) {
     unsigned char cur = ascii_string[x];
-    sprintf(&buf[idx], "0x%02.2x,", cur);
+    sprintf(&buf[idx], "0x%02x,", cur);
     idx += 5;
     if ((++(*i) % HEX_BYTES_PER_LINE) == 0) {
       sprintf(&buf[idx], NEWLINE);
