aboutsummaryrefslogtreecommitdiff
path: root/unix/os/zflink.c
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /unix/os/zflink.c
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'unix/os/zflink.c')
-rw-r--r--unix/os/zflink.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/unix/os/zflink.c b/unix/os/zflink.c
new file mode 100644
index 00000000..34b5a780
--- /dev/null
+++ b/unix/os/zflink.c
@@ -0,0 +1,45 @@
+/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+ */
+
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <stdio.h>
+#define import_kernel
+#define import_knames
+#define import_spp
+#include <iraf.h>
+
+
+/* ZFLINK -- Create a file symlink.
+ */
+int
+ZFLINK (
+ PKCHAR *path1,
+ PKCHAR *path2,
+ XINT *status
+)
+{
+ /* Create a symlink 'path2' pointing to 'path1'.
+ */
+ *status = (symlink ((char *) path1, (char *) path2) < 0) ? XERR : XOK;
+
+ return (*status);
+}
+
+
+/* ZFULNK -- Remove a file symlink.
+ */
+int
+ZFULNK (
+ PKCHAR *path,
+ XINT *status
+)
+{
+ /* Remove the link at 'path'.
+ */
+ *status = (unlink ((char *) path) < 0) ? XERR : XOK;
+
+ return (*status);
+}