29,7 → 29,6 |
|
#include <stdlib.h> |
#include <ctype.h> |
//#include "//kolibc.h" |
|
//extern int access(char *file, int mode); |
|
106,6 → 105,8 |
#define O_BINARY 0 |
#endif |
|
int write_once(const char *name, void *buffer, unsigned len); |
|
boolean |
M_WriteFile |
( char const* name, |
112,16 → 113,21 |
void* source, |
int length ) |
{ |
FILE *handle; |
// FILE *handle; |
int count; |
|
handle = fopen ( name, "wb"); |
// handle = fopen ( name, "wb"); |
|
if (handle == NULL) |
return false; |
// if (handle == NULL) |
// return false; |
|
// printf("writeFile %s, &s, %d \n\r", name, source, length); |
count = write_once(name, source, length); |
|
// printf("%d \n\r", count); |
|
// count = fwrite (source, 1, length, handle); |
fclose (handle); |
// fclose (handle); |
|
if (count < length) |
return false; |