Skip to content

Commit

Permalink
System folder ensurement implementation for Rishka VM.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed May 13, 2024
1 parent f6b5151 commit a994cdb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/rishka_vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,23 @@ String RishkaVM::getWorkingDirectory() {
return String(this->workingDirectory.c_str());
}

void RishkaVM::ensureSystemDirectories() {
if(!SD.exists("/bin"))
SD.mkdir("/bin");

if(!SD.exists("/etc"))
SD.mkdir("/etc");

if(!SD.exists("/home"))
SD.mkdir("/home");

if(!SD.exists("/man"))
SD.mkdir("/man");

if(!SD.exists("/tmp"))
SD.mkdir("/tmp");
}

inline int64_t RishkaVM::shiftLeftInt64(int64_t a, int64_t b) {
if(b >= 0 && b < 64)
return ((uint64_t) a) << b;
Expand Down

0 comments on commit a994cdb

Please sign in to comment.