Question
Write a C program to perform the following. Read the name of an ftp command, identify whether it is a valid command or not and
Write a C program to perform the following. Read the name of an ftp command, identify whether it is a valid command or not and print a line indicating the command is valid or invalid.
The list of valid ftp command to use for this question is: (1) ascii, (2) recv (and/or get), (3) send (and/or put), (4) rmdir, (5) mkdir, (6) pwd, (7) ls, (8) cd, (9) status and (10) quit.
The pseudo code is given below.
Step 1: Read an ftp command into a character array from keyboard using gets function or scanf.
Step 2: Identify what command it is using strcmp function.
Step 3: For valid ftp command print a line of output as: pwd is a valid ftp command
For invalid ftp command print a line of output as: xyz is not a valid ftp command
Display the content of source code file hw3q2.c.
Run the executable file which will produce output.
NOTE: You can run the program multiple times testing for valid ftp commands and one invalid command. Alternately, you can write a loop around Step 1 to 3 and loop until quit command is typed.
Step by Step Solution
3.54 Rating (151 Votes )
There are 3 Steps involved in it
Step: 1
The code is as follow include include int isValidCommandchar command char val...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started