#include "stdio.h"
-#include <sys/types.h>
-#include <unistd.h>
-
-
-
#define _LARGEFILE64_SOURCE
#include <stdio.h>
#include <sys/types.h>
+
+#if defined(_WIN32)
+#else
#include <unistd.h>
+#endif // defined(_WIN32)
+
#include <stdlib.h>
#include <errno.h>
#include <string.h>
long long pos;
long long lsize = dimX*dimY*1 *dataSize;
+
+
+#if defined(_WIN32)
+ _sopen_s( &fd, filename.c_str(), _O_RDONLY, _SH_DENYNO, 0 );
+#else
fd = open ( filename.c_str() , O_RDONLY|O_LARGEFILE );
+#endif // defined(_WIN32)
+
+
+
if (fd < 0)
{
printf("EED ReadMHDPlane::Read64lseek \n");
newImage->AllocateScalars();
newImage->Update();
pos = dimX*dimY*(long long)bbGetInputSlice()*dataSize;
+
+
+
+#if defined(_WIN32)
+ if (_lseeki64( fd, pos, SEEK_SET ) < 0)
+#else
if (lseek64(fd, pos, SEEK_SET) < 0)
+#endif // defined(_WIN32)
+
{
printf("EED ReadMHDPlane::Read64lseek \n");
fprintf(stderr, "Failed seeking to %lld, %s\n", pos, strerror(errno));
}
} // if PLANE XY
-
+ /*
if (bbGetInputDirectionPlane()=="XZ")
{
long long int j;
}
pImage=pImage+dimX*dataSize;
} // for j
- } // if PLANE XY
+ } // if PLANE XZ
if (bbGetInputDirectionPlane()=="YZ")
}
}
} // for j
- } // if PLANE XY
-
+ } // if PLANE YZ
+ */
+#if defined(_WIN32)
+ _close (fd);
+#else
close (fd);
+#endif // defined(_WIN32)
bbSetOutputOut( newImage );
} // if