#include
#include
#include
#include
#include
#include
void set_menu_choice();
int main()
{
set_menu_choice();
exit(0);
}
void set_menu_choice()
{
int fd,filename;
filename = "/linux_c/c/cd_name.txt";
if(access(filename, 0) != 0)
{
fd = open(filename,O_CREAT | O_TRUNC | O_RDWR,0666);
if(fd < 0)
{
perror("open /tmp/cd_name.txt error:\n");
exit(1);
}
close(fd);
}
printf("-----------------------------\n");
printf("a) Add new CD\n");
printf("f) Find CD\n");
printf("c) Count the CDs and tracks in the catalog\n");
struct stat buf;
stat (filename,&buf);
if (buf.st_size == 0)
{
printf("l) List tracks on cdtitle\n");
printf("r) Remove cdtitle\n");
printf("u) Update track information for cdtitle\n");
}
printf("-----------------------------\n");
}
阅读(704) | 评论(0) | 转发(0) |