Applets
The copy command provided using the operating system cannot copy files that are implicit or systematically attribute, because the system will prompt "File Not Found" during the copy. The following applet can solve this problem. // copyfile.c # include # include main (int Argc, char * argv []) {if (argc <3) {printf ("/ n usage: Copyfile / N "); EXIT (1);} Copy (Argv [1], Argv [2]);} Copy (Char * file1, char * file2) {char ch; file * fp1, * fp2 ; if (fp1 = fopen (file1, "rb"))) == null) {Printf ("/ ncan't open file% s", file1); fclose (fp1); return;} if ((fp2 = fopen) (file2, "wb")) == null) {Printf ("/ ncan't open file% s", file2); fclose (fp1); return;} ch = fgetc (fp1); while (! feof (fp1 ))) {FPUTC (CH, FP2); CH = FGETC (FP1);} fclose (fp1); fclose (fp2);} II, the name DOS of the locale in any DOS version or Windows is just 6. A program for changing a sub-record name is available in the X version. Change the directory name operation in Windows is very cumbersome. The following applets can simply change the name of any primary subdirectory, and can also be used to change the name of the file. # include "stdio.h" Main (int Argc, char * argv []) {INT N; IF (ARGC <3) {Printf ("Required Parameter Missing / N"); exit (0);} n = rename Argv [1], Argv [2]); if (n == - 1) {Printf ("Duplicate Name or Name Not Found / N); exit (0);}} IF, using a space-wide directory list In DOS, it is not allowed to include spaces in the file name or subdirectory name. This is because the system is to distinguish the parameters of the input DOS commands, which uses DOS's MD, CD, RD, and other commands that contain spaces. However, when checking the disk with the chkdsk command, the sub-directory name containing the space does not give an error message. This shows that the directory name containing spaces in DOS is legitimate. Since the command in DOS cannot use a space-containing directory name, you can play a certain encryption. The following program describes how to build, enter and delete subdirectory containing spaces using C language. 1, built a subdirectory / * file name: mddir.c * / # include main (int Argc, char * argv []) {if (argc == 2) {IF (MKDIR (Argv [1])) PERROR ("ERROR");} else printf ("USAGE: MDDIR DIRNAME / N"); return (0);} Note in the program use to enclose the directory with a dual quotation number, if the directory There is no space in the name to omit the double quotes. For example: MDDIR "a test".