gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r11851 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r11851 - gnunet/src/util
Date: Mon, 21 Jun 2010 19:27:20 +0200

Author: durner
Date: 2010-06-21 19:27:20 +0200 (Mon, 21 Jun 2010)
New Revision: 11851

Modified:
   gnunet/src/util/disk.c
Log:
Windows impl of GNUNET_DISK_file_get_identifiers, untested

Modified: gnunet/src/util/disk.c
===================================================================
--- gnunet/src/util/disk.c      2010-06-21 17:26:41 UTC (rev 11850)
+++ gnunet/src/util/disk.c      2010-06-21 17:27:20 UTC (rev 11851)
@@ -260,6 +260,26 @@
       *ino = (uint64_t) sbuf.st_ino;
       return GNUNET_OK;
     }
+#elif WINDOWS
+  // FIXME NILS: test this
+  struct GNUNET_DISK_FileHandle *fh;
+  BY_HANDLE_FILE_INFORMATION info;
+  int succ;
+
+  fh = GNUNET_DISK_file_open(filename, GNUNET_DISK_OPEN_READ, 0);
+  if (fh == NULL)
+    return GNUNET_SYSERR;
+  succ = GetFileInformationByHandle(fh->h, &info);
+  GNUNET_DISK_file_close(fh);
+  if (succ)
+    {
+      *dev = info.dwVolumeSerialNumber;
+      *ino = ((info.nFileIndexHigh << sizeof(DWORD)) | info.nFileIndexLow);
+      return GNUNET_OK;
+    }
+  else
+    return GNUNET_SYSERR;
+
 #endif
   return GNUNET_SYSERR;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]