Write An Essay logo
  • Home
  • Dissertation Writing
  • Essay Writing
  • Personal Statement
  • My account
  • Order now
Order Now
Uncategorized

programming assisnment

1 min read
Posted on 
March 30th, 2022
Home Uncategorized programming assisnment

 

Write a command-line program to determine file type under Unix

When running your program with a file name as the input parameter, it should return the type of the file, such as ‘text file’, ‘executable file’, ‘C++ source code’, etc.

As we discussed in class, there are four possible ways to determine the type of a file:

  • Comparing the file extension to a list of known extensions;
  • By reading the first byte of the file and comparing it to a list of existing magic code;
  • Examining the return from a stat() system call;
  • For text files, read the contents of the file and try to figure it out;

For the purpose of this homework, you don’t have to implement all of the above four. Two will suffice. Any file that can’t be recognized should show ‘unknown type’.

Submit your source code and a test run result (either a ‘script’ file, or a screenshot).

Order an Essay Now & Get These Features For Free:

Turnitin Report

Formatting

Title Page

Citation

Outline

Place an Order
Share
Tweet
Share
Tweet
Calculate the price
Pages (275 words)
$0.00
Write An Essay
Company
  • Why Choose Us
  • About Us
  • Terms
  • Dissertation Help
  • Personal Statement
  • Research Paper Format
  • Term Papers
Legal
  • Write My Essay
  • Thesis Format
  • Custom Papers
  • Coursework Writing
  • Dissertation Writing
  • Essay Writing
How Our Service is Used:
Write An Essay essays are NOT intended to be forwarded as finalized work as it is only strictly meant to be used for research and study purposes. Write An Essay does not endorse or condone any type of plagiarism.
Subscribe
No Spam
© 2023 Write An Essay. All rights reserved.
Write An Essay will be listed as ‘Write An Essay’ on your bank statement.