Rev 1085 |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
/*
*
*
*
*/
#include <ll/i386/cons.h>
#include <kernel/func.h>
#include <fs/bdevinit.h>
#include <fs/fsinit.h>
#include <fs/bdev.h>
#include <drivers/keyb.h>
#include <sys/mount.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include "common.h"
#define FILENAME "/TEMP/TESTW0.TXT"
extern dev_t temp_device
;
int main
(int argc
,char *argv
[])
{
int res
;
// int c;
int h
;
showmessage
("Try to create and truncate a file.\n");
cprintf
("OPENING %s\n",FILENAME
);
h
=open
(FILENAME
,O_CREAT
|O_WRONLY
|O_TRUNC
);
if (h
!=-1) {
cprintf
("CLOSING %s\n",FILENAME
);
res
=close
(h
);
if (res
!=0) {
cprintf
("CLOSE FAILED!\n");
cprintf
("errno: %i '%s'\n",errno
,strerror(errno
));
}
} else {
cprintf
("FAILED!\n");
cprintf
("errno: %i '%s'\n",errno
,strerror(errno
));
}
waitend
();
return 0;
}