Now I changed the code and its isn't working now also.
Here is the code:
Code:
- #include <stdio.h>
- #include <stdlib.h>
- int hide_file(char *host, char *hidden, char *name);
- int show_file(char *hostfile, char *filename);
- int main(void){
- char hostfile[75], hiddenfile[75], hiddenFileName[15];
- int status1, status2;
- printf("Enter the name(with extension) and path of the file whose behind you want to hide another file: ");
- scanf("%75s", hostfile);
- printf("Enter the path(with name and extension of the file) to the file you want to hide: ");
- scanf("%75s", hiddenfile);
- printf("Enter the name of the file you want to hide: ");
- scanf("%15s", hiddenFileName);
- status1 = hide_file(hostfile, hiddenfile, hiddenFileName);
- if (status1 == 0) {
- printf("Stream created and file is hidden. \n");
- status2 = show_file(hostfile, hiddenFileName);
- } else{
- printf("Something went wrong");
- }
- getchar();
- getchar();
- return 0;
- }
- int hide_file(char *host, char *hidden, char *name){
- int status = 0;
- char everything[150];
- sprintf(everything, "type \"%s\" > \"%s:%s\"", hidden, host, name);
- status = system(everything);
- return status;
- }
- int show_file(char *hostfile, char *filename){
- int status_2 = 0;
- char see_hidden[150];
- sprintf(see_hidden ,"notepad %s:%s",hostfile, filename );
- status_2 = system(see_hidden);
- return status_2;
- }