* \todo Implement changing of the parent directory when a file is written to\r
* \todo Implement file creation / deletion\r
*/\r
-#define DEBUG 0\r
+#define DEBUG 1\r
#define VERBOSE 1\r
\r
#define CACHE_FAT 1 //!< Caches the FAT in memory\r
-#define USE_LFN 1 //!< Enables the use of Long File Names\r
+#define USE_LFN 0 //!< Enables the use of Long File Names\r
#define SUPPORT_WRITE 0\r
\r
#include <acess.h>\r
\r
// == VFS Interface\r
node = &diskInfo->rootNode;\r
- node->Size = bs->files_in_root;\r
+ //node->Size = bs->files_in_root;\r
+ node->Size = -1;\r
node->Inode = diskInfo->rootOffset; // 0:31 - Cluster, 32:63 - Parent Directory Cluster\r
node->ImplPtr = diskInfo; // Disk info pointer\r
node->ImplInt = 0; // 0:15 - Directory Index, 16: Dirty Flag, 17: Deletion Flag\r
\r
// Sanity Check offset\r
if(offset > Node->Size) {\r
- LOG("Reading past EOF (%i > %i)", offset, node->Size);\r
+ LOG("Reading past EOF (%i > %i)", offset, Node->Size);\r
LEAVE('i', 0);\r
return 0;\r
}\r
// Clamp Size\r
if(offset + length > Node->Size) {\r
LOG("Reading past EOF (%lli + %lli > %lli), clamped to %lli",\r
- offset, length, node->Size, node->Size - offset);\r
+ offset, length, Node->Size, Node->Size - offset);\r
length = Node->Size - offset;\r
}\r
\r
char *FAT_int_CreateName(fat_filetable *ft, char *LongFileName)\r
{\r
char *ret;\r
- int len;\r
ENTER("pft sLongFileName", ft, LongFileName);\r
#if USE_LFN\r
if(LongFileName && LongFileName[0] != '\0')\r
{ \r
- len = strlen(LongFileName);\r
- ret = malloc(len+1);\r
- strcpy(ret, LongFileName);\r
+ ret = strdup(LongFileName);\r
}\r
else\r
{\r