summaryrefslogtreecommitdiff
path: root/current_directory.c
diff options
context:
space:
mode:
authornasrlol <nsrddyn@gmail.com>2025-02-10 22:03:54 +0100
committernasrlol <nsrddyn@gmail.com>2025-02-10 22:03:54 +0100
commit9359850dd1944e0331f42c25d969c6f2770ca9b2 (patch)
tree8b4076a20757cf981d3fa86e1d07091050296a28 /current_directory.c
parent0df51505f5d7035de1ad2007e08ea0d3bf365669 (diff)
worked on an algorithm for the echo function
Diffstat (limited to 'current_directory.c')
-rw-r--r--current_directory.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/current_directory.c b/current_directory.c
new file mode 100644
index 0000000..a9eec1b
--- /dev/null
+++ b/current_directory.c
@@ -0,0 +1,37 @@
+/*
+ * =====================================================================================
+ *
+ * Filename: current_directory.c
+ *
+ *
+ * Version: 1.0
+ * Created: 02/10/2025 10:26:51 AM
+ * Revision: none
+ * Compiler: gcc
+ *
+ * Author: YOUR NAME (),
+ * Organization:
+ *
+ * =====================================================================================
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <linux/limits.h>
+
+int main()
+{
+ char cwd[PATH_MAX];
+ if (getcwd(cwd, sizeof(cwd)) != NULL)
+ printf("%s", cwd);
+ else {
+ perror("getcwd() error");
+ return 1;
+ }
+ return 0;
+}
+
+
+
+
+