Linux create my own shell question! about pipe

I have a problem of this code
When I run this code, the error message : no file or directory
Can you solve this error for me?
Thank you!

#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <sys/stat.h>
#define DILIM " \t\n"

int main() {
   char write[256];
   char *save;
   char *str;
   char *args[10];
   int argn, pid,status;
   int i,j,fd,type;
   pid_t pid2;
   int pipefd[2];
   char *fcmd[10];
   char *lcmd[10];
   int k = 0;


   while(1){
   /* cmd input*/
   printf("command : ");   
   fgets(write,sizeof(write),stdin);
   argn = 0;
   str=strtok_r(write, DILIM, &save);

   while(str){
      args[argn++]=str;
      str = strtok_r(NULL,DILIM,&save);
      }   args[argn] = NULL;

   /*if you input "quit" = process exit*/
        if(argn == 0) continue;
        if(!strcmp(args[0], "quit")) break;
  
      for(i=0;i<argn;i++){
         /*redirection*/
         if(!strcmp(args[i],">")){
            type = 1;
            break;}
         else if(!strcmp(args[i],"<")){
            type = 2;
            break;}
         /*pipe*/
         else if(!strcmp(args[i], "|")){
            type = 3;
            for(j = 0; args[j] != NULL; j++){
               fcmd[j] = args[j];            
               if(!strcmp(args[j],"|")){         
               fcmd[j] = NULL;               
               break;   }
               }
            for(j = j + 1; args[j] != NULL; j++){
               lcmd[k] = args[j];
               k++;               
               }
               lcmd[k] = NULL;
               break;   }
               }      
    pid = fork();
    if(pid > 0) wait(&status);
    else if(pid == 0)
      {
      args[i] == NULL;
         /*type1 ">"*/
         if(type == 1) {

         fd = open(args[i + 1], O_RDWR | O_CREAT | S_IROTH, 0644);
         dup2(fd, 1);
         close(fd);
         for(i = i; args[i] != NULL; i++){
            args[i] = args[i+2];
            }      
            args[i] = NULL;
         }
         /*type2 "<"*/
         else if(type == 2){
     
         fd = open(args[i + 1], O_RDONLY);
         dup2(fd, 0);
         close(fd);
         for(i = i; args[i] != NULL; i++){
            args[i] = args[i+2];
            }
            args[i] = NULL;
         }
         /*type3 "|"*/
         else if(type == 3){
  
            pipe(pipefd);
            pid2 = fork();
  
            if(pid2 > 0)
            {
            /*Child Process*/
            dup2(pipefd[0],0);
            close(pipefd[0]);
            close(pipefd[1]);
            execvp(fcmd[0], fcmd);
            return 0;   
            }
            if(pid2 == 0){
            /*Parent Process*/
            dup2(pipefd[1],1);
            close(pipefd[0]);
            close(pipefd[1]);
            execvp(lcmd[0], lcmd);
            return 0;
            }   
         }   
         /*not "<,>,|" */
         else
          execvp(args[0], args);
            }
   else printf("fork() error !!!\n");   
   }
}