下面哪条命令可用来确保文件“myfile”存在()
A:cp myfile /devull B:touch myfile C:create myfile D:mkfile myfile
给定程序的功能是:调用函数fun将指定源文件中的内容复制到指定的目标文件中,复制成功时函数返回值为1,失败时返回值为0。在复制的过程中,把复制的内容输出到终端屏幕。主函数中源文件名放在数组sfname中,目标文件名放在数组tfname中。
请在程序的下画线处填入正确的内容并把下画线删除,使程序得出正确的结果。
注意:源程序存放在考生文件夹下的BLANK1.C中。不得增行或删行,也不得更改程序的结构。
文件BLANK1.C内容如下:
#include<stdio.h>
#include<stdlib.h>
int fun(char *source,char *target)
FILE *fs,*ft;
char ch;
/**********found**********/
if((fs=fopen(source, (1) ))==NULL)return 0;
if((ft=fopen(target,"w"))==NULL)return 0;
printf("/nThe data in file: /n");
eh=fgetc(fs);
/**********found**********/
while(!feof( (2) ))
putehar(ch);
/**********found**********/
fpute(ch, (3) );
ch=fgetc(fs);
fclose(fs);
fclose(ft);
printf("/n/n");
return 1;
void main( )
char sfname[20]="myfile1",tfname[20]="myfile2";
FILE *myf;
int i;
char c;
myf=fopen(sfname,"w");
printf("/nThe original data: /n");
for(i=1;i<30;i++)
c=’A’+rand( )%25;
fprintf(rayf,"%c",c);
printf("%c",c);
fclose(myf);
printf("/n/n"):
if(fun(sfnaille,tfname)) printf("Succeed!");
else printf("Fail!");
Which UNIX command creates a symbolic link named myfile in the current directory to the file/etc/hosts
A:In -s/etc/hosts myfile B:In -s myfile/etc/hosts C:link -s/etc/hosts myfile D:link -s myfile/etc/hosts
执行下列命令后,当前打开的数据库文件名是 Number="3" File="File"+Number USE &File
A:File3 B:&File C:FileNumber D:File
执行下列命令后,当前打开的数据库文件名是 ______。 Number="ABC" File="File"+Number USE &File
A:FileABC B:&File C:File Number D:File
Which UNIX command creates a symbolic link named myfile in the current directory to the file /etc/hosts ( )
A:In —s/etc/hosts myfile B:In —s myfile/etc/hosts C:link —s/etc/hosts myfile D:link —s myfile/etc/hosts
下面创建一个新文件对象方法错误的是( )。
A:File myFile; myFile=new File("mulu/file"); B:File myFile=new file( ); C:myFile=new File("/mulu","filel"); D:File myDir=new file("/mulu"); myFile=new File(Dir"filel");
下面的程序执行后,文件test.t中内容是______。 #include<stdio.h> void fun(char *fname,char*st) {FILE*myf,int i; myf=fopen(fname,"w"); for(i=0;i<strlen(st);i++)fputc(st[i],myf); fclose(myf); } main( ) {fun("test.t","new world");fun("test.t","hello,");}
A:hello, B:new worldhello C:new world D:hello, rld