Operating System Unit 3 - University of The People
Operating System Unit 3 - University of The People
manipulating files and directories on a computer's storage device. This can be done
using various file system functions or libraries in programming languages such as
PHP. (Gomakethings, Aug 2022).
Example: In PHP, the scandir() function can be used to retrieve a list of files and
directories in a specified directory.
$dir = "/path/to/directory";
$files = scandir($dir);
foreach ($files as $file) {
echo $file . "<br>";
}
Handling memory: Memory management involves allocating and releasing memory
resources in a computer's RAM. This is an important concept to understand when
developing applications, as poorly managed memory can lead to performance issues
and crashes. (Simplilearn, Feb 2023).
Example: In C++, memory can be allocated dynamically using the new keyword, and
released using the delete keyword.
int* ptr = new int;
*ptr = 10;
delete ptr;