I need help with the C program here. Whatever I've, I wrote it here: In this lab you will write a C program to read a list of files and perform some operations on the list. Imagine that we are creating something just a little bit like the ls command on unix or the dir command on windows. If you are not familiar with these commands, think of it as providing functionality similar to the file explorer on windows or the finder on MacOS. Create a date.h file for the date structure and prototypes. The date struct has members for month, day, and year. All members are ints. Include the prototype for the function to compare two dates. Create a date.c file with a function to compare two dates and return true if they are equal. Create a myfiles.h file for the file structure and prototypes The file struct will have the following members: file name (60 chars plus room for null byte) number of bytes date created date last modified Our list command will have the following options. Write a function for each one. Create a myfiles.c file to hold these functions: Given an array of files and a FILE pointer, read from the file into the array. Return the number of files read. You can assume that the array will have room for all the data in the file. List all file names. List all info for all files. List all files with a given file type. Pass the file type as a parm. Extract the file type from the file name by searching for the last . in the file name, then taking all characters after that . List all files where the name contains the given string. List all files created on the given date. List all files modified on the given date. Create a main funtion in file testfiles.c to test your file "class": Create an array of 100 files. Create a FILE pointer for the input file myfiles.dat Call your function to read the file information into the array. List all file names. List all info for all files. Present a menu to the user so the user can choose an option and enter the appropriate info: list by file type, list where name contains a string, list by create date, list by modify date. Put this menu in a loop so the user can enter multiple requests. Hints In C the constant for null is NULL. This constant is defined in stdio.h, as well as other header files. It must be written in all caps. Put the data file in the same directory as your code. You can find a number of helpful functions in string.h. You might be interested in using strlen, strrchr, strncpy, strcmp, and strstr. input file: filelist.dat arithtest.class 674 3 9 2012 3 12 2012 arithtest.java 592 3 7 2012 3 12 2012 ArrayFracTest.class 1398 10 26 2014 11 13 2014 ArrayFracTest.java 1634 10 20 2014 11 13 2014 ArrayFracTest.out 880 10 20 2014 10 20 2014 array.html 4476 11 1 2014 2 22 2015 array.in 8754 7 4 2014 11 1 2014 Base.class 2462 3 2 2105 3 18 2015 Base.java 2808 2 1 2015 3 24 2015 Base.out 46 3 2 2015 3 18 2015 bkl52.jpg 2484 9 3 2011 9 3 2011 Cat.html 782 1 6 2010 6 7 2012 CollTest.class 1490 8 12 2007 8 15 2007 CollTest.java 1266 8 7 2007 8 15 2007 Column.html 1910 4 5 2009 4 8 2009 filewrite.out 4082 5 29 2008 7 16 2010 first.names 222 4 19 2009 4 23 2011 HTTPGet.class 1560 1 21 2011 7 13 2012 HTTPGet.java 1288 1 12 2011 7 13 2012 img_3321.jpg 4052 12 4 2012 12 4 2012 img_5003.jpg 3876 12 4 2012 12 4 2012 img_5004.jpg 5218 11 29 2008 11 29 2012 index.html 3570 8 22 2007 4 20 2015 infile.dat 8256 7 7 2013 7 12 2012 main.css 7386 8 26 2007 9 1 2009 names.dat 144 1 6 2015 1 6 2015 names.out 678 1 6 2015 1 19 2015 nums.dat 5922 2 10 2011 2 22 2011 nums.out 12820 2 10 2011 2 28 2011 person.in 372 12 14 2013 1 19 2014 puppies.jpg 1494 6 20 2010 6 20 2010 TinyHTTPD.class 2756 7 14 2012 8 2 2012 TinyHTTPD.java 3250 7 10 2012 8 2 2012

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter7: Developing An Excel Application
Section: Chapter Questions
Problem 2.9CP
icon
Related questions
Question

I need help with the C program here. Whatever I've, I wrote it here:

In this lab you will write a C program to read a list of files and perform some operations on the list. Imagine that we are creating something just a little bit like the ls command on unix or the dir command on windows. If you are not familiar with these commands, think of it as providing functionality similar to the file explorer on windows or the finder on MacOS.

Create a date.h file for the date structure and prototypes. The date struct has members for month, day, and year. All members are ints. Include the prototype for the function to compare two dates.

Create a date.c file with a function to compare two dates and return true if they are equal.

Create a myfiles.h file for the file structure and prototypes The file struct will have the following members:

file name (60 chars plus room for null byte)
number of bytes
date created
date last modified
Our list command will have the following options. Write a function for each one. Create a myfiles.c file to hold these functions:

Given an array of files and a FILE pointer, read from the file into the array. Return the number of files read. You can assume that the array will have room for all the data in the file.
List all file names.
List all info for all files.
List all files with a given file type. Pass the file type as a parm. Extract the file type from the file name by searching for the last . in the file name, then taking all characters after that .
List all files where the name contains the given string.
List all files created on the given date.
List all files modified on the given date.
Create a main funtion in file testfiles.c to test your file "class":

Create an array of 100 files.
Create a FILE pointer for the input file myfiles.dat
Call your function to read the file information into the array.
List all file names.
List all info for all files.
Present a menu to the user so the user can choose an option and enter the appropriate info: list by file type, list where name contains a string, list by create date, list by modify date. Put this menu in a loop so the user can enter multiple requests.
Hints

In C the constant for null is NULL. This constant is defined in stdio.h, as well as other header files. It must be written in all caps.
Put the data file in the same directory as your code.
You can find a number of helpful functions in string.h. You might be interested in using strlen, strrchr, strncpy, strcmp, and strstr.
input file: filelist.dat

arithtest.class 674 3 9 2012 3 12 2012

arithtest.java 592 3 7 2012 3 12 2012

ArrayFracTest.class 1398 10 26 2014 11 13 2014

ArrayFracTest.java 1634 10 20 2014 11 13 2014

ArrayFracTest.out 880 10 20 2014 10 20 2014

array.html 4476 11 1 2014 2 22 2015

array.in 8754 7 4 2014 11 1 2014

Base.class 2462 3 2 2105 3 18 2015

Base.java 2808 2 1 2015 3 24 2015

Base.out 46 3 2 2015 3 18 2015

bkl52.jpg 2484 9 3 2011 9 3 2011

Cat.html 782 1 6 2010 6 7 2012

CollTest.class 1490 8 12 2007 8 15 2007

CollTest.java 1266 8 7 2007 8 15 2007

Column.html 1910 4 5 2009 4 8 2009

filewrite.out 4082 5 29 2008 7 16 2010

first.names 222 4 19 2009 4 23 2011

HTTPGet.class 1560 1 21 2011 7 13 2012

HTTPGet.java 1288 1 12 2011 7 13 2012

img_3321.jpg 4052 12 4 2012 12 4 2012

img_5003.jpg 3876 12 4 2012 12 4 2012

img_5004.jpg 5218 11 29 2008 11 29 2012

index.html 3570 8 22 2007 4 20 2015

infile.dat 8256 7 7 2013 7 12 2012

main.css 7386 8 26 2007 9 1 2009

names.dat 144 1 6 2015 1 6 2015

names.out 678 1 6 2015 1 19 2015

nums.dat 5922 2 10 2011 2 22 2011

nums.out 12820 2 10 2011 2 28 2011

person.in 372 12 14 2013 1 19 2014

puppies.jpg 1494 6 20 2010 6 20 2010

TinyHTTPD.class 2756 7 14 2012 8 2 2012

TinyHTTPD.java 3250 7 10 2012 8 2 2012

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage