Function invoked by the kernel layer to install OS specific file systems.
| 576 | /// Function invoked by the kernel layer to install OS specific |
| 577 | /// file systems. |
| 578 | bool Platform::FS::InstallFileSystems() |
| 579 | { |
| 580 | Platform::FS::Mount( "/", Platform::FS::createNativeFS( String() ) ); |
| 581 | |
| 582 | // Setup the current working dir. |
| 583 | char buffer[PATH_MAX]; |
| 584 | if (::getcwd(buffer,sizeof(buffer))) |
| 585 | { |
| 586 | // add trailing '/' if it isn't there |
| 587 | if (buffer[dStrlen(buffer) - 1] != '/') |
| 588 | dStrcat(buffer, "/"); |
| 589 | |
| 590 | Platform::FS::SetCwd(buffer); |
| 591 | } |
| 592 | |
| 593 | // Mount the home directory |
| 594 | if (char* home = getenv("HOME")) |
| 595 | Platform::FS::Mount( "home", Platform::FS::createNativeFS(home) ); |
| 596 | |
| 597 | return true; |
| 598 | } |