--- /dev/null
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <dirent.h>
+#include <sys/types.h>
+#include <sys/xattr.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/acl.h>
+#include <gpfs.h>
+
+static const char *sys_proc_fd_path(int fd, char *buf, size_t bufsize)
+{
+ int written;
+
+ written = snprintf(buf,
+ bufsize,
+ "/proc/self/fd/%d",
+ fd);
+ if (written >= bufsize) {
+ return NULL;
+ }
+
+ return buf;
+}
+
+int main(int argc, char **argv)
+{
+ const char *p = NULL;
+ char buf[PATH_MAX];
+ int fd;
+ int ret;
+ struct gpfs_winattr attrs = {0};
+
+ if (argc < 2) {
+ printf("Usage: %s FILE\n");
+ return 1;
+ }
+
+ fd = open(argv[1], O_PATH);
+ if (fd == -1) {
+ return 1;
+ }
+
+ p = sys_proc_fd_path(fd, buf, sizeof(buf));
+ if (p == NULL) {
+ return 1;
+ }
+
+ attrs.winAttrs = GPFS_WINATTR_HIDDEN;
+
+ ret = gpfs_set_winattrs_path(p,
+ GPFS_WINATTR_SET_ATTRS,
+ &attrs);
+ if (ret != 0) {
+ printf("gpfswrap_set_winattrs_path [%s] failed: %s\n",
+ p, strerror(errno));
+ return 1;
+ }
+
+ return 0;
+}
+