Describe two possible extensions of your script

Assignment Help Programming Languages
Reference no: EM132249864

Assignment

Task 1: Script programming

Consider the following situation:

You are given a directory from a webserver that contains multiple HTML files as well as multiple files of other types (e.g. images). The directory may contain subdirectories. You are asked to clean up this directory and its subdirectories by removing all unused files. A file is considered unused if it is not linked in any of the HTML files or if it is not specified explicitly that this file is in use. A file can be linked in a HTML file by either a href or img src. It does not matter whether the link is within a commented-out section of the HTML file. Do not remove subdirectories.

The files you remove must be stored in a user-specified directory. You need to maintain the directory structure when storing the removed files (e.g. if you remove two files a/b/a.txt and a/a.txt, both files must be stored under their directories).

You also need to create statistics output for the files that have been removed. The statistics output must be in text form and must contain, for each file ending, the number of files and the overall size of files with that ending. In addition, the number and size of all removed files needs to be reported. For this purpose, file- endings are not case-sensitive (i.e. .gif and .GIF are considered the same for statistics purposes). The statistics must also contain the name of the directory on which the cleanup script has been run.

T1.1: Write a Perl script to automate this task. The script must be run as follows: cleanup.pl [CleanupDir] [RubbishBinDir] [ListOfUsedFiles] where
[CleanupDir ] is the name of the directory to clean up.
[RubbishBinDir ] is the name of the directory where removed files are to be stored.
[ListOfUsedFiles ] is a list of 0 or more files that are in use and should not be deleted.

Your script must handle errors such as missing parameters, missing files, missing di- rectories, missing access permissions, or input/output errors gracefully, that is, it must not crash on encountering them. Depending on what is appropriate, your script may handle errors by displaying a warning and continuing, by displaying an error message and aborting, or by taking other actions (e.g. creating a missing directory). Your script should try to fix problems, if this is possible.

T1.2: Discuss, in at most 300 words, why script programming is particularly suited for problem, and describe two possible extensions of your script and how they could be achieved.

Assessment criteria for Task 1.1

1. The script will be run against the directory www/ in the provided archive example.zip. The script will be run in the directory example/ as follows:
rm -Rf report.txt rubbish-bin/
cleanup.pl www/ rubbish-bin/ index.html > report.txt
After the script has run, the contents of the directory www/ should be exactly like the contents of the directory www-after/, the directory rubbish-bin/ should exist and have the same contents the directory has now, and the file report.txt must exist and contain the same text as it contains now.

2. Your script will be tested against several other directories, using different combinations of parameters that are allowed according to the description.

3. Your script will be manually inspected for code quality.

Attachment:- assignment questions.zip

Reference no: EM132249864

Questions Cloud

Discounting and consumption costs : Assume the value of a QALY is $100,000, and ignore discounting and consumption costs.
What kind of hypothesis would you test : As scientists conducting an experiment, you need to have an experimental group and a control group for testing a hypothesis. If you were a scientist.
South korea differ from that in thailand : According to Mushtaq H. Khan, how does the process of rent-seeking in South Korea differ from that in Thailand?
Discussion about the strategic management : Strategy formulation starts with developing a vision and mission statement, creating a SWOT analysis, deciding on long-term objectives.
Describe two possible extensions of your script : Discuss, in at most 300 words, why script programming is particularly suited for problem, and describe two possible extensions of your script
Businesses looking to sell abroad : How does the lower demand for U.S. dollars affect the value of the U.S. dollar, and consequently, is this good or bad for U.S. businesses looking to sell abroad
Required reserve ratio imposed : 1. Consider the following accounts of the First National Bank.
Find an interesting report of a scientific discovery : Find an interesting report of a scientific discovery that was in the news within the last five years. Your initial source can be a newspaper, journal.
Explain the behavior of the federal reserve : Explain the behavior of the Federal Reserve considering a balance of payments disequilibria within a fixed exchange rate system.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd