- Added "lsdir" function to libck ktcc.

- Added "fs" folder to build.bat in libck for tcc.
- Updated libck and dir_example

git-svn-id: svn://kolibrios.org@8289 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
superturbocat2001
2020-12-01 16:19:41 +00:00
parent e34d1445df
commit 5451715e39
5 changed files with 90 additions and 12 deletions

View File

@@ -3,7 +3,20 @@
#include <stdbool.h>
#define rmfile(obj) rmdir(obj)
#define PATH_MAX 4096
#define PATH_MAX 4096
#define T_FOLDER 16
#define T_FILE 0
#define FS_ERROR -1
typedef struct {
unsigned type;
char *name;
} short_file_info;
//Writes information about files in the "dir" folder to an struct array"list". Returns the number of files.
int lsdir(const char* dir, short_file_info **list);
// Get the path to the working directory(if buf is NULL, then memory will be allocated automatically)
char *getcwd(char *buf, unsigned size);
@@ -11,10 +24,13 @@ char *getcwd(char *buf, unsigned size);
// Set path to working directory
void setcwd(const char* cwd);
// Remove directory (returns "true" if successful)
// Delete empty folder (returns "true" if successful)
bool rmdir(const char* dir);
// Create directory (returns "true" if successful)
// Delete a file (returns "true" if successful)
bool rmfile(const char* name);
// Create a foldery (returns "true" if successful)
bool mkdir(const char* dir);
#endif