#include <stdio.h>
struct data_Interaction
{
int count;
char data_One[128];
char data_Two[1024];
char data_Three[1024];
};
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "structure_Function.h"
#define LS 1
#define PWD 2
#define GET 3
#define CD 4
int Strcmp(char *s)
{
if(strcmp(s,"ls")==0){
return LS;
}
if(strcmp(s,"pwd")==0){
return PWD;
}
if(strstr(s,"get")!=NULL){
return GET;
}
if(strstr(s,"cd")!=NULL){
return CD;
}
}
char *get_chdir(char *q)
{
char *t=NULL;
t=strtok(q," ");
t=strtok(NULL," ");
return t;
}
void get_Des(struct data_Interaction msg,int c_fd)
{
int fd;
int size;
int count=0;
int remainder=0;
int w_write;
int n_read;
int ret;
char buf[1024]={
0};
char *from_GetChdir=NULL;
FILE *r=NULL;
ret = Strcmp(msg.data_One);
printf("msg.data_One:%s\n",msg.data_One);
memset(msg.data_Two,0,sizeof(msg.data_Two));
switch(ret){
case CD :
from_GetChdir=get_chdir(msg.data_One);
ch