|
|
int RetVal = 0; | int RetVal = 0; |
FILE *InF = NULL; | FILE *InF = NULL; |
FILE *TempF = NULL; | FILE *TempF = NULL; |
char TempPath[16]; |
char *TempPath = (char *) malloc(sizeof(char) * strlen(ipInFN)+14); |
struct stat StatBuf; | struct stat StatBuf; |
struct utimbuf UTimeBuf; | struct utimbuf UTimeBuf; |
int fd; | int fd; |
|
|
if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) | if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) |
RetVal = -1; | RetVal = -1; |
| |
strcpy (TempPath, "./d2utmpXXXXXX"); |
strcpy (TempPath, ipInFN); |
|
strcat (TempPath, "_u2dtmpXXXXXX"); |
if((fd=mkstemp (TempPath))<0) { | if((fd=mkstemp (TempPath))<0) { |
perror("Failed to open output temp file"); | perror("Failed to open output temp file"); |
RetVal = -1; | RetVal = -1; |
|
|
RetVal = -1; | RetVal = -1; |
} | } |
} | } |
|
free (TempPath); |
return RetVal; | return RetVal; |
} | } |
| |
|
|
int RetVal = 0; | int RetVal = 0; |
FILE *InF = NULL; | FILE *InF = NULL; |
FILE *TempF = NULL; | FILE *TempF = NULL; |
char TempPath[16]; |
char *TempPath = (char *) malloc(sizeof(char) * strlen(ipInFN)+14); |
struct stat StatBuf; | struct stat StatBuf; |
struct utimbuf UTimeBuf; | struct utimbuf UTimeBuf; |
mode_t mode = S_IRUSR | S_IWUSR; | mode_t mode = S_IRUSR | S_IWUSR; |
|
|
else | else |
mode = StatBuf.st_mode; | mode = StatBuf.st_mode; |
| |
strcpy (TempPath, "./u2dtmpXXXXXX"); |
strcpy (TempPath, ipInFN); |
|
strcat (TempPath, "_u2dtmpXXXXXX"); |
if((fd=mkstemp (TempPath))<0) { | if((fd=mkstemp (TempPath))<0) { |
perror("Failed to open output temp file"); | perror("Failed to open output temp file"); |
RetVal = -1; | RetVal = -1; |
|
|
} | } |
RetVal = -1; | RetVal = -1; |
} | } |
|
free (TempPath); |
return RetVal; | return RetVal; |
} | } |
| |