summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSkiz <skiznet@aol.com>2024-10-02 16:37:30 -0400
committerSkiz <skiznet@aol.com>2024-10-02 16:37:30 -0400
commit1338817f622c0ced4d404bf1e896c5f6127bf0fa (patch)
tree1d853a451bf51bf9f66dd3e3afe2c3692ddaadcd
parentbfa9033ff4a6995009c2b4950133cb35227ab1b9 (diff)
Somehow it works and doesn't work at the same time
-rw-r--r--spwd.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/spwd.c b/spwd.c
index e69de29..a29a964 100644
--- a/spwd.c
+++ b/spwd.c
@@ -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;
+}