diff options
author | Skiz <skiznet@aol.com> | 2024-10-02 16:37:30 -0400 |
---|---|---|
committer | Skiz <skiznet@aol.com> | 2024-10-02 16:37:30 -0400 |
commit | 1338817f622c0ced4d404bf1e896c5f6127bf0fa (patch) | |
tree | 1d853a451bf51bf9f66dd3e3afe2c3692ddaadcd | |
parent | bfa9033ff4a6995009c2b4950133cb35227ab1b9 (diff) |
Somehow it works and doesn't work at the same time
-rw-r--r-- | spwd.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +#include <stdio.h> +#include <unistd.h> + +int main(void) { + + char buffer[1024]; + + //_getcwd(buffer, 1024); + + if (getcwd(buffer, sizeof(buffer)) != NULL) { + printf("Current working dir: \n\n%s\n", buffer); + } else { + perror("getcwd() error"); + } + + printf("Furrent working dir: \n\n%s\n", buffer); + + + return 0; +} |