Trent King CIT 436 Lab 4
.docx
keyboard_arrow_up
School
University of Phoenix *
*We aren’t endorsed by this school
Course
0102
Subject
Computer Science
Date
May 4, 2024
Type
docx
Pages
6
Uploaded by ProfWillpower13160 on coursehero.com
Trent King CIT 436 2/4/2024 Lab 4
Here, we look at <Directory> containers. a. (2) Search forward for <Directory />. This is the first <Directory> container in the file. What does / reference?
Upon searching for <Directory /> in the httpd.conf file, I found that it references the root directory
of the entire file system. This directive is set to disallow all access by default, enhancing the security by preventing unauthorized access to the entire filesystem from the web.
The container disallows all access to this directory and all beneath it. (2) The next <Directory> container is for DocumentRoot. It contains Options, AllowOverride directives and Require all granted. What does the Require directive do and why is it necessary for this directory?
The Require all granted directive allows access to the DocumentRoot directory, making it necessary to ensure the website's content is accessible to all users.
Options allows us to specify what options are allowed or not allows for requests in this directory (and subdirectories as options are inherited). What Options are permited for DocumentRoot?
For the DocumentRoot, I permitted options Indexes, FollowSymLinks, and ExecCGI, enabling directory listings, following symbolic links, and executing scripts.
Create a new <Directory> container beneath the one for DocumentRoot for /usr/local/apache2/htdocs/second (recall the container will end with </Directory>). Place Options
-FollowSymLinks in this container, save your conf file, and (1) restart Apache. In your web browser, test second/users. What happens? You tested this earlier (prior to step 1) and it should
have worked, why did it not work now? What does -FollowSymLinks mean? If you had a subdirectory beneath second, would that subdirectory permit or not permit symbolic links to be followed?
After creating a new <Directory> container for /usr/local/apache2/htdocs/second with Options -
FollowSymLinks and restarting Apache, testing second/users in the web browser resulted in an error, specifically, the symbolic link to /etc/passwd could not be followed. Previously, this link worked because symbolic links were allowed by default. The -FollowSymLinks option disables the ability to follow symbolic links, enhancing security by preventing access to files outside of the intended directory structure. Consequently, with -FollowSymLinks set for the second directory, any subdirectory beneath second would also inherit this restriction, disallowing the following of symbolic links unless explicitly overridden by another directive at a deeper level.
In your web browser, try the URL ipaddress/second (no filename) which should result in either returning an index file or displaying the directory’s contents. Which one happens here?
When I tried accessing the URL ipaddress/second without specifying a filename, Apache returned the directory's contents as a listing. This behavior indicates that the Options directive for this directory includes Indexes, allowing the server to display a list of files in the directory when no specific index file is present or specified in the request.
Change the directive you added in 2b to Options -Indexes. Save the file and (1) restart Apache. Refresh your browser. Instead of the directory listing, you get an error. What error? Why didn’t you get an index file?
Changing to Options -Indexes and refreshing the browser led to a 403 Forbidden error because this setting prevents directory listings and no index file was available to be served.
Change the Options statement to Options Multiviews, save your conf file, (1) restart Apache and
refresh your browser. What happens this time?
Setting Options Multiviews, restarting Apache, and refreshing the browser enabled content negotiation, allowing Apache to serve the closest match for the request from the second directory.
Add a + before Multiviews in the Options directive, save your conf file, (1) restart Apache and refresh your browser. What happens now? What can you conclude about Options that have minus (-) versus Options that have no sign before them versus Options that have a plus (+)?
Adding +Multiviews, restarting Apache, and refreshing showed similar content negotiation as before. The + adds to existing options, - removes them, and no sign sets options directly, allowing precise control over Apache's directory behaviors.
With Options +MultiViews, Indexes is inherited again from DocumentRoot. Now we can change how the directory listing appears in the web browser. (2) In the <Directory> container for second, add the directive IndexOptions +FancyIndexing, save the conf file, (1) restart Apache, and refresh browser. How does the directory listing differ from how it appeared in 1c?
After adding IndexOptions +FancyIndexing, restarting Apache, and refreshing, the directory listing became more detailed and visually appealing, showing file icons, sizes, and modification dates, unlike the basic list seen before.
Replace +MultiViews with -Indexes and delete the IndexOptions directive. We do this because Indexes constitutes a security problem. Why?
Replacing +MultiViews with -Indexes and deleting the IndexOptions directive is done because allowing directory listings can be a security risk. It exposes the structure and contents of the server's directories to anyone, potentially revealing sensitive files or information about the server setup that could be exploited by attackers. Removing Indexes prevents unauthorized directory browsing, enhancing the server's security.
In your web browser, type the URL ipaddress. This loads your index file, but which one?
When I typed the URL ipaddress into my web browser, it loaded the index.html file. This is because the Apache configuration file's DirectoryIndex directive prioritizes index.html as the default file to display when no specific file is requested in the URL.
A little below the <Directory> container for second you should find the <IfModule> container for dir_module which has one directive, DirectoryIndex. This directive specifies valid names for index files. Add index.txt after index.html in this directive, save your conf file, (1) restart Apache and refresh your browser. What index file does Apache respond with?
After adding index.txt after index.html in the DirectoryIndex directive within the <IfModule> container for dir_module, saving the configuration file, restarting Apache, and refreshing my browser, Apache responded with the index.html file. This is because DirectoryIndex searches
for the listed files in the order they are specified, serving the first one it finds. Since index.html exists and is listed before index.txt, it is served to the client.
Reverse the order of the two file names in the directive, save the conf file, (1) restart Apache and refresh your browser. Which version loads now? What can you conclude about the DirectoryIndex directive?
After reversing the order of the file names in the DirectoryIndex directive to list index.txt before index.html, saving the configuration file, restarting Apache, and refreshing my browser, Apache served the index.txt file. This demonstrates that the DirectoryIndex directive prioritizes the files in the order they are listed. If the first listed file is found, it is served, and Apache does not continue to look for the subsequent files. This behavior allows for flexibility in specifying default documents for a directory.
In steps d and e you have seen the role of Options Indexes and DirectoryIndex. Describe all of the possibilities that Apache will respond with when it receives a URL which contains no filename, such as ipaddress or ipaddress/second.
If Indexes enabled and no DirectoryIndex file: Displays directory listing. If Indexes disabled and no DirectoryIndex file: Returns a 403 Forbidden error. If a DirectoryIndex file exists: Serves that file. If no DirectoryIndex file exists and Indexes disabled: Also returns a 403 Forbidden error.
You want to change Options or some other directives for your directory but you cannot add or modify the <Directory> container in the conf file. Should you ask the web administrator to make the changes? No, Apache gives us a better way: the access file.
Apache allows using an .htaccess file for directory-level configuration changes. This method enables me to modify Options and other directives without editing the main httpd.conf file, eliminating the need to ask the web administrator for these changes.
Type fg to resume vi. The <Files> container matches .htaccess and has one directive: to deny access. Does this mean that you, as the web developer, cannot use an access file? Explain.
The <Files> directive that denies access to .htaccess files is for security, ensuring they're not accessible via a web browser. However, this doesn't affect my ability to use .htaccess for configuration; the server still reads and applies these files, keeping the configurations effective while securing them from external access.
This creates .htaccess with the directive in place to permit Indexes (which overrides what the <Directory> container did in the conf file). In your web browser, enter the URL ipaddress/second. What happens? Why didn’t the access file override the Option in the <Directory> container as expected?
When I entered ipaddress/second in my web browser after creating .htaccess with Options +Indexes, it didn't override the -Indexes setting from httpd.conf as expected. This occurred because the AllowOverride directive for the directory in httpd.conf was set to None or didn't specifically allow overriding Options, preventing .htaccess from enabling directory listings.
Scroll back to the <Directory> container for htdocs and you will find AllowOverride None. Change this to AllowOverride All, save your conf file, (1) restart Apache and refresh your browser. Did these changes work? The AllowOverride directive is used to control what access
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Create File comparators that arrange files in ascending/descending order of file size, ascending/descending order of file name, and ascending/descending order of last modification date. Employ these comparators in LS, a programme that accepts a command-line input and lists the files in the current directory in a certain order, such as "-t" to sort by timestamp.To break ties, support several flags. Be certain you use a reliable sort.
arrow_forward
I have the following code but it is not running correctly!
import csvlst = []def save_dict_to_csv(storage, file_name): with open(file_name, 'w', newline = '') as f: f.write(file_name) f.write('\n') for key, value in storage.items(): lst1 = [] lst1.append(str(key)) for val in value : if type(val) == list: for v in val: lst1.append(str(v)) else: lst1.append(str(val)) for i in range(len(lst1)): if i != (len(lst1) - 1): f.writelines(lst1[i] + ',') else: f.writelines(lst1[i]) f.writelines('\n') f = open(file_name) print(f.read())
if __name__ == "__main__": storage = { 101: ["quiz", 12, [1,2,3,4]], 102: ["final", 53, [10, 10, 10, 10]] } res = save_dict_to_csv(storage,…
arrow_forward
modify minishell.c to run who, ls, and date with option. who will show the count of users, ls will list files in long listing format and date will show UTC time.
Modify this file so the shell can run commands with options.*/#include <stdio.h>#include <unistd.h>#include <sys/types.h>#include <sys/wait.h>#include <stdlib.h>#include <fcntl.h>
int main(int argc, char *argv[]){ char *cmd[] = {"who", "ls", "date"}; int i;
while(1){ printf("0=who 1=ls 2=date : "); scanf( "%d", &i ); if(i<0 || i>2) continue; pid_t result= fork(); if(result==0) { /* child */ execlp( cmd[i], cmd[i], (char *)0 ); printf("execlp failed\n"); exit(1); } else if (result >0){ /* parent */ int status; wait(&status); } else{ //handle error } } return 0;}
arrow_forward
Problem
Given the target file f0 and candidate files f1-f20, there is an identical copy of f0 among the files f1-f20.
Write a python program to perform the following tasks:
· Read in each file and calculate the hex hash values by using SHA3 function with the length of 512 for all the given files f0, f1-f20.
· Save the hex hash values of each file as a new line in a .txt file named hash.txt file.
· Read hash values from hash.txt and compare them to find the identical copy of f0 among f1-f20.
· Write the finding result (the matched file name) back to hash.txt
Submission
• Name your project fileHash.py and submit both fileHash.py and hash.txt on Blackboard.
• The program should be properly documented.
• The program should have user friendly Input/Output design
• Duplicate work (or obviously similar one) will result in an F grade in the course.
Grading
1. Include comments as specified in the course syllabus. (10%)
2. Source code and results.
· Correctness (70%)
· User-friendliness…
arrow_forward
Can you please fix the error in houses.cpp.
It’s 3 files. lab2 main.cpp, house.h and house.cpp.
this is Lab2mian.cpp: #include
#include
#include "House.h"
using namespace std;
// Already implemented for you do not modify
int main() {
House house1("Lionel Messi", "34 Cedarwood Road", 5, 2.5, 2500000.00);
House house2("Neymar da Silva Santos Junior", "12 Broadway Street", 7, 4, 5600000.00);
House house3(house1);//Copy constructor
House house4;
house4 = house2;//Copy assignment
// convert house to string and print
string house1String = house1;
cout << house1String << endl;
string house2String = house2;
cout << house2String << endl;
string house3String = house3;
cout << house3String << endl;
string house4String = house4;
cout << house4String << endl;
cout << "----------------------------" << endl << endl;
House house5(std::move(house1));//Move constructor
House house6("Luke Shaw", "33 Picadilly…
arrow_forward
Python Pandas: Suppose I have a file with columns I want to specify the spacing so that there are 5 spaces between the columns, how do I do this?
file1
12 12.3 9.3
23 3.5 45.6
34 6.1 88.9
arrow_forward
Suppose that you wished to copy all of the text files from your fileAsst directory and all of the files from your fileAsst/TweedleDee directory into your current directory (without typing out the name of each individual file). What command would you give to make that copy?
Here is an attachment of the tree.
arrow_forward
IN SCALA PLEASE
COULD YOU COMPLETE THE CODE OF FUNCTIONS: get_csv_url, process_ratings, process_movies, groupById, favourites, suggestions and recommendations
import io.Source
import scala.util._
// (1) Implement the function get_csv_url which takes an url-string
// as argument and requests the corresponding file. The two urls
// of interest are ratings_url and movies_url, which correspond
// to CSV-files.
//
// The function should ReTurn the CSV-file appropriately broken
// up into lines, and the first line should be dropped (that is without
// the header of the CSV-file). The result is a list of strings (lines
// in the file).
def get_csv_url(url: String) : List[String] = ???
val ratings_url = """https://nms.kcl.ac.uk/christian.urban/ratings.csv"""
val movies_url = """https://nms.kcl.ac.uk/christian.urban/movies.csv"""
// testcases
//-----------
//:
//val movies = get_csv_url(movies_url)
//ratings.length // 87313
//movies.length // 9742
// (2) Implement two functions that…
arrow_forward
Sort files by size and date of last modification. Write comparators for the typeFile to order by increasing/decreasing order of file size, ascending/descending orderof file name, and ascending/descending order of last modification date. Use thesecomparators in a program LS that takes a command-line argument and lists the filesin the current directory according to a specified order, e.g., "-t" to sort by timestamp.Support multiple flags to break ties. Be sure to use a stable sort.
arrow_forward
I have an issue with trying to modify my code, I need to instead to work such that a user imputs a file paths and the program synchronizes themthe code is too long to post so I have placed it belowhttps://github.com/Philanthropenos/2023-final-work-for-os-class/blob/main/Attempt1.1
arrow_forward
With the exception of fp being a file pointer rather than a file descriptor and the return value being an int status rather than a location, the standard library method int fseek(FILE *fp, long offset, int origin) is identical to Iseek. Compose fseek. Ensure that the caching used for the other library functions and your fseek are correctly coordinated.
arrow_forward
Question 1
a) Explain the difference between ls -l > mylisting.txt and ls -l >> mylisting.txt
b) Create a shell script that lists all the files in the present working directory in
long format name this file listMyFiles.sh. Write a c program that uses the
system () function and uses it to run listMyFiles.sh
c) Create a daemon in C in the Unix environment, your daemon must create a
text file called aitDaemonLog.txt and populate it with 1000 lines of a string
each line must be written after 10 seconds, the string must end with the count
of the string;
arrow_forward
What happens if i os: : out is used by itself to open a file that does not exist?
arrow_forward
1. In indexed file allocation method, assuming that the block can only store 8 pointers as shown in the figure (see attached file) , what happens if the file needs 10 pointers? Give the advantages and disadvantages of this method.
2. What could be the advantage/s and disadvantage/s of using the following free space management schemes:
a. Grouping
b. Counting
arrow_forward
With linked allocation, each file is a linked list of disk blocks; the disk blocks may be scattered anywhereon the disk. The directory contains a pointer to the first and last blocks of the file. Each block contains a pointerto the next block. Refer to the illustration below.
Need help to fill in the codes in void main() ---
#include<stdio.h>#include<stdlib.h>#define TOTAL_DISK_BLOCKS 32#define TOTAL_DISK_INODES 8int blockStatus[TOTAL_DISK_BLOCKS]; // free = 0int blockList[TOTAL_DISK_BLOCKS - TOTAL_DISK_INODES]; // list of blocks of a filestruct file_table {char fileName[20];int fileSize;struct block *sb;};struct file_table fileTable[TOTAL_DISK_BLOCKS - TOTAL_DISK_INODES];struct block {int blockNumber;struct block *next;};int AllocateBlocks(int Size) {---}void main(){int i = 0, j = 0, numFiles = 0, nextBlock= 0, ret = 1;char s[20]; struct block *temp;---for(i = 0; i < numFiles; i++) {---ret = AllocateBlocks(fileTable[i].fileSize);---}---//Seed the pseudo-random number…
arrow_forward
) Write Linux commands for the following:i) Copy a file test1.py from Prac01 directory to Subdir1 directory in the followingdirectory structure.FOPPrac01Prac02Prac03-Subdir1Subdir2(Where FOP is at the top level then Prac01, 02 and 03 are at next level and Subdir1and 2 are next to next level.)ii) To delete a directory DIR which has a file test2.py in it.
arrow_forward
write c program? plz single c file
write a program that will copy all files under the given folder to another one. In order to be able to complete this assignment, you have to research how to obtain the list of files in a directory in Linux. You must copy each file in a separate process. The folder name should be obtained from the arguments. You must perform all error checks?
arrow_forward
1) Create a daemon in C in the Unix environment, your daemon must create a text file called aitDaemonLog.txt and populate it with 1000 lines of a string each line must be written after 10 seconds, the string must end with the count of the string;.
2)Create a shell script that lists all the files in the present working directory in long format name this file listMyFiles.sh. Write a c program that uses the system() function and uses it to run listMyFiles.sh
3)Write a c program to write a string of your own choosing into shared memory then read the contents of the shared memory created in
4)demonstrate in a c program how to use a fork to create a child process, using pipes let this child process send a message which is read by the parent process
5) Write a c program that shows the PID, PPID, UID and GID of a running process, let this process fork thus creating a child process, let the parent process count from 0 to 50 and the child process from 0 to 25 each process showing while counting…
arrow_forward
modify task6.c to create a tool that remove those files from the current working directory. You can use strstr() function to search for .bak, or .old in entry->d_name.
Modify this program to clean up .bak .old files.*/
#include <stdio.h>#include <dirent.h>#include <string.h>#include <errno.h>#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include <time.h>
int main(int argc, char *argv[]){ if(argc!=1) return 1;
char *path = "."; //current working directory DIR *dir = opendir(path);
if(dir==NULL){ fprintf(stderr, "Cannot open dir %s: %s\n", path, strerror(errno)); return 1; }
struct dirent *entry; while((entry=readdir(dir))!=NULL){ printf("%ld %s\n", entry->d_ino, entry->d_name); }
arrow_forward
Write comparators for the type File that arrange files according to file size, file name, and last modification date, in that order, in addition to ascending and descending. Utilise these comparators in the LS programme, which accepts a command-line input and shows the files in the current directory in the desired order, for example, "-t" to sort by timestamp. To break ties, back many flags. Use a stable sort, please
arrow_forward
You shall implement a Microshell, “MSH”. MSH shall provide the following functions:
Provide a shell-like interface for launching new programs:
When MSH starts running, it will print a prompt "cssc0000% " (replace cssc0000 with your username) and then wait for the user to type in a file name. Note, MSH will NOT have any shell built-in functions (such as cd, setenv, printenv, bg, fg, etc), with the exception of #5 (below).
When the user enters a filename and hits the “enter” key, MSH then reads the filename entered and determines if the file is an executable file. If it isn't, MSH will print a useful error message to the user and then return to #1 above (display a new prompt and wait for user input). If it is an executable file, then MSH will create a new process and run this program in the new process.
Note – you will need to determine whether the filename is a fully qualified path name or if the file needs to be searched for (fully qualified pathnames begin with a slash (i.e. "/"),…
arrow_forward
In this task, we would like to generate a keyed hash (i.e. MAC) for a file. We can use the “-hmac” option (this option is currently undocumented, but it is supported byopenssl). The following example generates a keyed hash for a file using the HMAC-MD5 algorithm. The string following the “-hmac” option is the key. “openssl dgst -md5 -hmac "abcdefg" filename” Please generate a keyed hash using HMAC-MD5, HMAC-SHA256, and HMAC-SHA1 for any file that you choose. Please try several keys with different lengths. 1. Do we have to use a key with a fixed size in HMAC? 2. If so, what is the key size? 3. If not, why?
arrow_forward
Using only BufferedReader and BufferedWriter to read/write files and only arrays for any data structure needs, create a static method reverseLineOrder which accepts the arguments:
Filename to the input file as a String
Filename of the output file as a String
The method will create a new file with the lines from the given data set in reverse order.
Data.txt:
1 2 3 4 5 6 7 8 9 0
9 8 7 6 5 4 3 2 1 0
8 7 6 5 4 3 2 1 0 9
Subject: Java Programming
arrow_forward
in fedora 37
1. Create a directory named Module9 and navigate to that directory.
2. Copy the file pay.dat from Module8 to Module9. Here it is again, just in case:
0001:John Smith:15.40
0002:Jane Smith:15.41
0003:George Jungle:12.10
0004:Ursula Jungle:16.11
3. Using a pipe symbol for filtering and sort the data to stdout.
Enter: cat pay.dat | sort
4. Now, on your own, using a pipe symbol for filtering and sort the data in descending order to stdout and append that to a file named SortPay.dat.
5. Copy pay.dat to three files named: pay10,dat, pay12.dat, and pay02.txt. You may need to use multiple commands.
6. Use pattern matching to locate only pay02.txt.
7. Enter the command to remove pay2.dat and redirect both stdin and stdout to a file named RemovePay.txt.
8. Run the command in step 7 again.
9. Display the contents of RemovePay.txt
10. Take screen captures
please explain each step and take screenshots
arrow_forward
(a) In Java: we use class ……………………. to input text from a file. (b) Files created using byte-based streams are……… , while files created using character-based streams are………… {Fill in the 2 blanks from these: text files , binary files}.
(c) Write Java code to print 2-dimensional array arr1 and 2-dimensional array arrx in two different ways. (d) Given a generic class called MyFirstGenericC: In two lines of code: instantiate two objects of this class.
arrow_forward
Write a C program, called reverse, using standard I/O functions, to take a file as inputthen copies it to another file in reverse order. That is, the last byte becomes the first,the byte just before the last one becomes the second, etc.The program call should look like:reverse fileIn fileOutSubmit your source code and script files
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- Create File comparators that arrange files in ascending/descending order of file size, ascending/descending order of file name, and ascending/descending order of last modification date. Employ these comparators in LS, a programme that accepts a command-line input and lists the files in the current directory in a certain order, such as "-t" to sort by timestamp.To break ties, support several flags. Be certain you use a reliable sort.arrow_forwardI have the following code but it is not running correctly! import csvlst = []def save_dict_to_csv(storage, file_name): with open(file_name, 'w', newline = '') as f: f.write(file_name) f.write('\n') for key, value in storage.items(): lst1 = [] lst1.append(str(key)) for val in value : if type(val) == list: for v in val: lst1.append(str(v)) else: lst1.append(str(val)) for i in range(len(lst1)): if i != (len(lst1) - 1): f.writelines(lst1[i] + ',') else: f.writelines(lst1[i]) f.writelines('\n') f = open(file_name) print(f.read()) if __name__ == "__main__": storage = { 101: ["quiz", 12, [1,2,3,4]], 102: ["final", 53, [10, 10, 10, 10]] } res = save_dict_to_csv(storage,…arrow_forwardmodify minishell.c to run who, ls, and date with option. who will show the count of users, ls will list files in long listing format and date will show UTC time. Modify this file so the shell can run commands with options.*/#include <stdio.h>#include <unistd.h>#include <sys/types.h>#include <sys/wait.h>#include <stdlib.h>#include <fcntl.h> int main(int argc, char *argv[]){ char *cmd[] = {"who", "ls", "date"}; int i; while(1){ printf("0=who 1=ls 2=date : "); scanf( "%d", &i ); if(i<0 || i>2) continue; pid_t result= fork(); if(result==0) { /* child */ execlp( cmd[i], cmd[i], (char *)0 ); printf("execlp failed\n"); exit(1); } else if (result >0){ /* parent */ int status; wait(&status); } else{ //handle error } } return 0;}arrow_forward
- Problem Given the target file f0 and candidate files f1-f20, there is an identical copy of f0 among the files f1-f20. Write a python program to perform the following tasks: · Read in each file and calculate the hex hash values by using SHA3 function with the length of 512 for all the given files f0, f1-f20. · Save the hex hash values of each file as a new line in a .txt file named hash.txt file. · Read hash values from hash.txt and compare them to find the identical copy of f0 among f1-f20. · Write the finding result (the matched file name) back to hash.txt Submission • Name your project fileHash.py and submit both fileHash.py and hash.txt on Blackboard. • The program should be properly documented. • The program should have user friendly Input/Output design • Duplicate work (or obviously similar one) will result in an F grade in the course. Grading 1. Include comments as specified in the course syllabus. (10%) 2. Source code and results. · Correctness (70%) · User-friendliness…arrow_forwardCan you please fix the error in houses.cpp. It’s 3 files. lab2 main.cpp, house.h and house.cpp. this is Lab2mian.cpp: #include #include #include "House.h" using namespace std; // Already implemented for you do not modify int main() { House house1("Lionel Messi", "34 Cedarwood Road", 5, 2.5, 2500000.00); House house2("Neymar da Silva Santos Junior", "12 Broadway Street", 7, 4, 5600000.00); House house3(house1);//Copy constructor House house4; house4 = house2;//Copy assignment // convert house to string and print string house1String = house1; cout << house1String << endl; string house2String = house2; cout << house2String << endl; string house3String = house3; cout << house3String << endl; string house4String = house4; cout << house4String << endl; cout << "----------------------------" << endl << endl; House house5(std::move(house1));//Move constructor House house6("Luke Shaw", "33 Picadilly…arrow_forwardPython Pandas: Suppose I have a file with columns I want to specify the spacing so that there are 5 spaces between the columns, how do I do this? file1 12 12.3 9.3 23 3.5 45.6 34 6.1 88.9arrow_forward
- Suppose that you wished to copy all of the text files from your fileAsst directory and all of the files from your fileAsst/TweedleDee directory into your current directory (without typing out the name of each individual file). What command would you give to make that copy? Here is an attachment of the tree.arrow_forwardIN SCALA PLEASE COULD YOU COMPLETE THE CODE OF FUNCTIONS: get_csv_url, process_ratings, process_movies, groupById, favourites, suggestions and recommendations import io.Source import scala.util._ // (1) Implement the function get_csv_url which takes an url-string // as argument and requests the corresponding file. The two urls // of interest are ratings_url and movies_url, which correspond // to CSV-files. // // The function should ReTurn the CSV-file appropriately broken // up into lines, and the first line should be dropped (that is without // the header of the CSV-file). The result is a list of strings (lines // in the file). def get_csv_url(url: String) : List[String] = ??? val ratings_url = """https://nms.kcl.ac.uk/christian.urban/ratings.csv""" val movies_url = """https://nms.kcl.ac.uk/christian.urban/movies.csv""" // testcases //----------- //: //val movies = get_csv_url(movies_url) //ratings.length // 87313 //movies.length // 9742 // (2) Implement two functions that…arrow_forwardSort files by size and date of last modification. Write comparators for the typeFile to order by increasing/decreasing order of file size, ascending/descending orderof file name, and ascending/descending order of last modification date. Use thesecomparators in a program LS that takes a command-line argument and lists the filesin the current directory according to a specified order, e.g., "-t" to sort by timestamp.Support multiple flags to break ties. Be sure to use a stable sort.arrow_forward
- I have an issue with trying to modify my code, I need to instead to work such that a user imputs a file paths and the program synchronizes themthe code is too long to post so I have placed it belowhttps://github.com/Philanthropenos/2023-final-work-for-os-class/blob/main/Attempt1.1arrow_forwardWith the exception of fp being a file pointer rather than a file descriptor and the return value being an int status rather than a location, the standard library method int fseek(FILE *fp, long offset, int origin) is identical to Iseek. Compose fseek. Ensure that the caching used for the other library functions and your fseek are correctly coordinated.arrow_forwardQuestion 1 a) Explain the difference between ls -l > mylisting.txt and ls -l >> mylisting.txt b) Create a shell script that lists all the files in the present working directory in long format name this file listMyFiles.sh. Write a c program that uses the system () function and uses it to run listMyFiles.sh c) Create a daemon in C in the Unix environment, your daemon must create a text file called aitDaemonLog.txt and populate it with 1000 lines of a string each line must be written after 10 seconds, the string must end with the count of the string;arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education