From 328f6dd1a2c74f3ceb079312b5e3dff8ded2dd37 Mon Sep 17 00:00:00 2001 From: Shreejan Date: Fri, 26 Nov 2021 16:57:58 +0530 Subject: [PATCH] Entered the function which can rename a folder and find a file or folder --- CommandConsole.exe | Bin 53367 -> 54964 bytes MainCommands.h | 58 ++++++++++++++++++++++++++++++++++--- README.md | 6 ++-- main.c | 69 ++++++++++++++++++++++++++------------------- 4 files changed, 98 insertions(+), 35 deletions(-) diff --git a/CommandConsole.exe b/CommandConsole.exe index 2ef7b2b266d2c3758816c22082dbd1e013099341..ff3a81dc0433fff612f732bca5bbf5850bd56537 100644 GIT binary patch delta 15397 zcmc(F3shCtwe~uj0|FwC2$Ud?0~{5pQ4)<3Bzimc+=W z2#D<{ktnNph?HvS+>sW~^Q4%tZa|?Zm3)bm8rBDi?0fkpw9bmwTK)=J{i3y=e}L8y zS}7>s<=4=P#-OO*E}jyU8fFu%-Fz-u*`n3KtAkET>m7WW^-(Fq!CS5Ojv1WASmO;# z{Vz`y*sb8PQ&u}gYBwz1<#FK1{yR_FyCEcd2w)(GvXW@K5u?&a>Nk_I}kwx_-&mN zO}ypktWZ=eo3IDW*aE_)0P`)uPivfFA=(#{4!2i^d~!=NR0X6W!=YUa4#`@Vl?3!X z7{^%4abFB5ElGA?7uDC=j*X|0H4f&r71$?ICa53AOTEyXNLrYQ?y|ZZtg+t$IRey7 z^5OenRdf6!8oxJ=ddw$l$YZo> zt>yjZbKWp?puYZd5VB*@GtrL`yKgLC6}Iv?26`%(xp-`-T~-|sUvYW1i$aIXk!146 z_bcN(bG*GBDQFx_0IihbsLo@|_ac6}Xx329DUwn(7Y(rBI|e1#ihN@R%=j!P8>pqD zAEYtXEcew%g0_Q;dMB)0XQ^edE{Aid>5o2fYkHYLS5kAdj?CNL8jE||7mB7veZ7aMYj4meP z4nSI9Zz}5kK($9zD{;L5*>_msd=ePf!+?;BPx8K9pZJ@?EBxv3QA#+ga(R1rk`hiH zCFecY0zzi||8pybDU*N4N9LC^~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c-QGg=#!ED+2%67Bs+s$S#DJ)r$TUI)mPdT12dU+M`=eX<0$BJuktK^C#fY=L=WlE~6K2LOBD= zOW7=aUKH{tUq0(Z^c*L+#u@nIvAk1X2DZGC(p)^jCh23^va<>cOR`y}3$Yi_=Qy@< zGCy=8{H`zrphLZ+*cRt1H*TiW$#xq!IfkiD29jt%e#0Z$LgaLVUpiQUhIteKdD`H& z0tl@g*Cp*KAoMKdI`z*1X>m=mELWM+JBAatADo4`&S z@VW}bZa}>8T2rA9PjNzkSPc`4020Rd*xyIXhYWd*f?y z;2Z!F35zx?V<&;68#sRivQCeqY$v>T7V4KIiu@hl&>nJMpdqj8@ar-lL-AH@0o!$@ zxCO{8!)OzM(7*Dzw#q{OkM5Lrq+zD+clj#-MGao~I{)(3x|s z)r~;T8gkeUBycWB>J1ADdmT`|o{$aykYmp+Vih_F2-|{z4UFU75 L$Fw?6AMpQQ-H3=} diff --git a/MainCommands.h b/MainCommands.h index 1d28f05..5e76a2c 100644 --- a/MainCommands.h +++ b/MainCommands.h @@ -4,7 +4,7 @@ #include #include #include -#define SIZE 25 +#define SIZE 260 char change_dir[100]; @@ -130,7 +130,7 @@ void clearScreen() } // Fucntion to copy file -void copy() +void copy_file() { FILE *ptr1; FILE *ptr2; @@ -227,11 +227,13 @@ void help() printf(">>clr - This will clear the screen of the terminal\n\n"); printf(">>read - This will print the content of the file.\n\n"); printf(">>cnge - This will change your username and password\n\n"); - printf(">>copy - This will copy the contents of one file to another file.\n\n"); + printf(">>cfile - This will copy the contents of one file to another file.\n\n"); printf(">>sys - This will print the information of your OS.\n\n"); printf(">>echo - This will print anything which you have given. After writing echo press enter then write whatever you want and press enter.\n\n"); printf(">>root - This will print the username and password\n\n"); - printf(">>rname - This will rename the file name you want.\n\n"); + printf(">>rfile - This will rename the file with the name you want.\n\n"); + printf(">>rdr - This will rename the folder with the name you want.\n\n"); + printf(">>getf - This will confirm you that the fille or folder name you have given is present in the directory that you specified.\n\n"); } //function to list all the files in the current directory. @@ -489,4 +491,52 @@ void pcwd() { printf("%s\n", current_working_dir); } +} + +// Function to rename folder +void renameFolder(){ + getchar(); + char firstname[SIZE], lastname[SIZE]; + printf("Enter the current name of the folder: "); + fgets(firstname, SIZE, stdin); + firstname[strlen(firstname) - 1] = 0; + printf("Enter the new name of the folder: "); + fgets(lastname, SIZE, stdin); + lastname[strlen(lastname) - 1] = 0; + + int value = rename(firstname, lastname); + if(!value){ + printf("Successfully changed\n"); + } + else{ + printf("Cannot change\n"); + } +} + +// Function to find a file or folder in a folder +void getf(){ + getchar(); + char foldername[SIZE]; + printf("Enter the name of the folder or directory first: "); + fgets(foldername, SIZE, stdin); + foldername[strlen(foldername) - 1] = 0; + DIR *dp; + struct dirent *dirp; + + if ((dp = opendir(foldername)) == NULL) + { + printf("can't find %s\n", foldername); + } + else{ + printf("Enter the filename or foldername to find: "); + char reciepent[SIZE]; + fgets(reciepent, SIZE, stdin); + reciepent[strlen(reciepent) - 1] = 0; + while ((dirp = readdir(dp)) != NULL) + { + if (!strcmp(dirp->d_name, reciepent)) + printf("%s is presnt in the folder %s\n", dirp->d_name, foldername); + } + } + closedir(dp); } \ No newline at end of file diff --git a/README.md b/README.md index 86c0bbd..8612bdf 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,13 @@ The main program is written in the main.c file and the functions written there a - Write something in a file: wrte - Print the content of the file: read - Change the username and password: cnge -- Copy the contents of one file to another file: copy +- Copy the contents of one file to another file: cfile - Print the information of OS: sys - Print the thing you wanted: echo - Print username & password: root -- Rename the file: rname +- Rename the file: rfile +- Rename the folder: rdr +- To confirm that a file or folder is present in a directory specified by you: getf All the functions are written in **MainCommands.h** diff --git a/main.c b/main.c index f5b3192..8b63658 100644 --- a/main.c +++ b/main.c @@ -9,9 +9,8 @@ Language: C #include #include - //define variables -#define SIZE 25 +#define SIZE 260 void main_loop() { @@ -37,86 +36,98 @@ void main_loop() else if (strcmp(cmd_str, "cnge") == 0) { - change(); //calling the change function in the change_root.h + change(); } else if (strcmp(cmd_str, "help") == 0) { - help(); //calling the help function in the help_file.h + help(); } else if (strcmp(cmd_str, "list") == 0) { - list(); //calling the list function in the list_file.h + list(); } else if (strcmp(cmd_str, "date") == 0) { - date(); //calling the date function in the date_file.h + date(); } else if (strcmp(cmd_str, "calc") == 0) { - calc(); //calling the calc function in the calc_file.h + calc(); } else if (strcmp(cmd_str, "pcwd") == 0) { - pcwd(); //calling the pcwd function in the pcwd_file.h + pcwd(); } else if (strcmp(cmd_str, "make") == 0) { - make(); //calling the make function in the make_file.h + make(); } else if (strcmp(cmd_str, "wrte") == 0) { - wrte(); //calling the wrte function in the wrte_file.h + wrte(); } else if (strcmp(cmd_str, "wrta") == 0) { - wrta(); //calling the wrta function in the wrta_file.h + wrta(); } else if (strcmp(cmd_str, "remo") == 0) { - remo(); //calling the remo function in the remo_file.h + remo(); } else if (strcmp(cmd_str, "ccwd") == 0) { - ccwd(); //calling the ccwd function in the ccwd_file.h + ccwd(); } else if (strcmp(cmd_str, "mkdr") == 0) { - mkdr(); //calling the mkdr function in the file_mkdr1.h + mkdr(); } else if (strcmp(cmd_str, "rmdr") == 0) { - rmdr(); //calling the rmdr function in the rmdr_file.h + rmdr(); } else if (strcmp(cmd_str, "info") == 0) { - //You can give your name here. And email address. printf("Developer: Shreejan Dolai\nLanguage: C\nEmail Id: dolaishreejan@gmail.com\n(c)All rights reserved.\n\n"); printf("\n\n\n\n\n\n"); } else if (strcmp(cmd_str, "clr") == 0) { - clearScreen(); //calling the clearScreen function in the clr_file.h + clearScreen(); } else if (strcmp(cmd_str, "read") == 0) { - read_file(); //calling the open function in the open_file.h + read_file(); } - else if(strcmp(cmd_str, "copy") == 0){ - copy(); //calling the copy fucntion in the copy_file.h + else if (strcmp(cmd_str, "cfile") == 0) + { + copy_file(); } - else if(strcmp(cmd_str, "sys") == 0){ - int a = info_system(); //calling the copy fucntion in the system_info.h + else if (strcmp(cmd_str, "sys") == 0) + { + int a = info_system(); } - else if(strcmp(cmd_str, "echo") == 0){ - echo(); //calling the echo function in the echo_file.h + else if (strcmp(cmd_str, "echo") == 0) + { + echo(); } - else if(strcmp(cmd_str, "root") == 0){ + else if (strcmp(cmd_str, "root") == 0) + { rootDisplay(); } - else if(strcmp(cmd_str, "rname") == 0){ - renameFile(); //calling the renameFile function in the rename_file.h + else if (strcmp(cmd_str, "rfile") == 0) + { + renameFile(); + } + else if (strcmp(cmd_str, "rdr") == 0) + { + renameFolder(); + } + else if (strcmp(cmd_str, "getf") == 0) + { + getf(); } else { @@ -157,12 +168,12 @@ int main() printf("USERNAME:- "); fgets(username, 10, stdin); - username[strlen(username) -1] = 0; + username[strlen(username) - 1] = 0; printf("PASSWORD:- "); fgets(password, 10, stdin); password[strlen(password) - 1] = 0; - + fprintf(w_user, username); fprintf(wpasswd, password); fclose(w_user);