From c279c82a75093a7fde87ece311d8beaa8bde2882 Mon Sep 17 00:00:00 2001 From: MuQun Yang Date: Mon, 4 Dec 2000 14:55:59 -0500 Subject: [svn-r3072] Purpose: turn off "checking file and directory permission right" on windows platform Description: Adding #ifndef WIN32 #endif block at the corresponding test-file and test-dir functions. Solution: See above. Platforms tested: Win NT 4.0,5.0; and confirm the result the same on eirene and arabica --- tools/h5toh4.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/h5toh4.c b/tools/h5toh4.c index 5b72985..19f4bf3 100644 --- a/tools/h5toh4.c +++ b/tools/h5toh4.c @@ -128,6 +128,7 @@ main(int argc, char *argv[]) status = -1; break; } +#ifndef WIN32 if (test_file(h5_filename,O_EXCL,292) != 0 ) { /* 292 Decimal - 0444 Octal, a+r */ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "main", __FILE__, __LINE__); status = -1; @@ -139,7 +140,7 @@ main(int argc, char *argv[]) status = -1; break; } - +#endif h4_extension = HDstrdup("hdf"); h4_filename = BuildFilename(h5_filename,h4_extension); @@ -148,13 +149,13 @@ main(int argc, char *argv[]) status = -1; break; } - +#ifndef WIN32 if (test_file(h4_filename,O_CREAT|O_EXCL,436) != 0) { /* 436 Decimal - 0664 Octal, ug+rw,o+r */ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "main", __FILE__, __LINE__); status = -1; break; } - +#endif status = h5toh4(h5_filename, h4_filename); if ( status != 0 ) { DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "main", __FILE__, __LINE__); @@ -175,6 +176,7 @@ main(int argc, char *argv[]) status = -1; break; } +#ifndef WIN32 if (test_file(h5_filename,O_EXCL,292) != 0 ) { /* 292 Decimal - 0444 Octal, a+r */ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "main", __FILE__, __LINE__); status = -1; @@ -197,7 +199,7 @@ main(int argc, char *argv[]) status = -1; break; } - +#endif status = h5toh4(h5_filename, h4_filename); if ( status != 0 ) { DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "main", __FILE__, __LINE__); @@ -225,6 +227,7 @@ main(int argc, char *argv[]) status2 = -1; break; } +#ifndef WIN32 if (test_file(h5_filename,O_EXCL,292) != 0 ) { /* 292 Decimal - 0444 Octal, a+r */ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "main", __FILE__, __LINE__); status2 = -1; @@ -236,7 +239,7 @@ main(int argc, char *argv[]) status2 = -1; continue; } - +#endif h4_extension = HDstrdup("hdf"); h4_filename = BuildFilename(h5_filename,h4_extension); @@ -245,13 +248,13 @@ main(int argc, char *argv[]) status2 = -1; continue; } - +#ifndef WIN32 if (test_file(h4_filename,O_CREAT|O_EXCL,436) != 0) { /* 436 Decimal - 0664 Octal, ug+rw,o+r */ DEBUG_PRINT("Error detected in %s() [%s line %d]\n", "main", __FILE__, __LINE__); status2 = -1; continue; } - +#endif status = h5toh4(h5_filename, h4_filename); if ( status != 0 ) { fprintf(stderr,"Error: Problem with %s\n",h5_filename); -- cgit v0.12