57 lines
855 B
C
57 lines
855 B
C
|
|
|
||
|
|
|
||
|
|
#include "../fileSystem.h"
|
||
|
|
|
||
|
|
#include "../console.h"
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
char * directory2 = "./assets/";
|
||
|
|
|
||
|
|
fileSystem * filesystem = new fileSystem();
|
||
|
|
|
||
|
|
char * directory = "./assets/";
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
filesystem->writeFile( "./assets/testFile", "content of file" );
|
||
|
|
|
||
|
|
|
||
|
|
array * files = filesystem->readDir( directory );
|
||
|
|
|
||
|
|
int fileCount = files->length();
|
||
|
|
|
||
|
|
for ( int i = 0; i < fileCount; ++i )
|
||
|
|
{
|
||
|
|
|
||
|
|
char * filename = files->get( i );
|
||
|
|
|
||
|
|
char * path = directory->concatenate( filename );
|
||
|
|
|
||
|
|
char * source = filesystem->readFile( path );
|
||
|
|
|
||
|
|
|
||
|
|
printf("filename: %s\n", path);
|
||
|
|
|
||
|
|
printf("source: %s\n\n\n", source);
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
if( filesystem->ensureDirectory("./Some/example/assure") ) {
|
||
|
|
|
||
|
|
console.log("Directories successfuly created.");
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
if( filesystem->exists( "Some" ) ) {
|
||
|
|
|
||
|
|
console.log("Directories 'Some' does exist.");
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
void abort() {
|
||
|
|
|
||
|
|
|
||
|
|
}
|