From d9ba836b00a1232409e6433e38f2e270ea7e254c Mon Sep 17 00:00:00 2001 From: MuQun Yang Date: Tue, 5 Dec 2000 12:21:52 -0500 Subject: [svn-r3077] Purpose: a bug fix for windows Description: ignore checking the permission of file and directory on windows Solution: using ifndef WIN32 endif to ignore checking this feature. Will find how windows deal with file checking stuff later. Platforms tested: WIN 2000, and confirmed at eirene(Linux) --- tools/h4toh5main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/h4toh5main.c b/tools/h4toh5main.c index abf3d89..4af7b90 100644 --- a/tools/h4toh5main.c +++ b/tools/h4toh5main.c @@ -96,7 +96,7 @@ int main(int argc, char ** argv) { case 1: /* h4toh5 file1 */ h4_filename = argv[0]; - +#ifndef WIN32 if (test_file(h4_filename,O_EXCL,292) != 0 ) { /* 292 Decimal - 0444 Octal, a+r */ printf("the current hdf4 file name is not set properly.\n"); @@ -108,7 +108,7 @@ int main(int argc, char ** argv) { status = -1; break; } - +#endif /*0. check whether this file is an hdf file. */ if(!Hishdf(h4_filename)){ @@ -124,14 +124,14 @@ int main(int argc, char ** argv) { status = -1; break; } - +#ifndef WIN32 if (test_file(h5_filename,O_CREAT|O_EXCL,436) != 0) { /* 436 Decimal - 0664 Octal, ug+rw,o+r */ printf("permission of hdf5 file is not set properly.\n"); status = -1; break; } - +#endif status = h4toh5(h4_filename, h5_filename); if ( status == FAIL ) { @@ -149,6 +149,7 @@ int main(int argc, char ** argv) { h4_filename = argv[0]; h5_filename = argv[1]; +#ifndef WIN32 if (test_file(h4_filename,O_EXCL,292) != 0 ) { /* 292 Decimal - 0444 Octal, a+r */ printf("permission of hdf4 file is not set properly.\n"); @@ -162,6 +163,7 @@ int main(int argc, char ** argv) { break; } +#endif /*0. check whether this file is a hdf file. */ if(!Hishdf(h4_filename)){ @@ -171,6 +173,7 @@ int main(int argc, char ** argv) { break; } +#ifndef WIN32 if (test_file(h5_filename,O_CREAT|O_RDWR,436) != 0) { /* 436 Decimal - 0664 Octal, ug+rw,o+r */ printf("permission of hdf5 file is not set properly.\n"); status = -1; @@ -183,6 +186,7 @@ int main(int argc, char ** argv) { break; } +#endif status = h4toh5(h4_filename, h5_filename); if ( status == FAIL ) { printf("error in converting %sinto %s\n",h4_filename,h5_filename); -- cgit v0.12