1. Homepage
  2. Programming
  3. INFO1112 Computing 1B OS and Network Platforms - Assignment 2: Simple Nautilus

INFO1112 Computing 1B OS and Network Platforms - Assignment 2: Simple Nautilus

Engage in a Conversation
AustraliaUniversity of SydneySimple NautilusPythonShell

Assignment 2 - Simple Nautilus CourseNana.COM

This assignment is worth 20% of your overall grade for the course. CourseNana.COM

Due: Week 8, Thursday, September 22nd at 23:59:00, Sydney local time. CourseNana.COM

You are going to be writing an interactive application in Python that allows the user to send commands to a file management application and receive outputs. The application largely mocks common Unix commands such as ls , cd , pwd , and so on. CourseNana.COM

You will need to implement and thoroughly test your solution. On the high level, the application is capable of: CourseNana.COM

1. interpret commands received on standard input.
2. produce messages on standard output.
3. maintain some data structure that keeps track of a virtual name space.
4. create, delete and move virtual files and folders during program run time. 5. support user and permission management in addition to file management.
CourseNana.COM

In Linux system, you can interact with the Terminal prompt to navigate in the file system using
cd , to perform actions to create, move, delete and copy files using touch mv rm cp , to alter the CourseNana.COM

ownership and permission of files by chmod and to add or remove users by adduser deluser . CourseNana.COM

In this assignment, you need to write a Python program which provides an interactive prompt as if a Linux Terminal. Human users can interact with the Python program via standard input and standard output. One can input commands, and as a result, the program may print out feedback messages due to certain input. CourseNana.COM

Note that the system is incapable of storing content but purely the file system structure. This is an intensional design and therefore the size of a file is not defined and is omitted in the system. Similarly, the concept of time and group is omitted intentional. Please see the whole specification for more details. CourseNana.COM

The assignment has three tasks that you will need to implement and thoroughly test. You will be provided a test suite to assist in developing your solutions. CourseNana.COM

The three tasks are: CourseNana.COM

1. Implement a minimal Simple Nautilus. 2. Implement a simplified Simple Nautilus. 3. Implement a full Simple Nautilus. CourseNana.COM

Please read the whole specification to better understand these tasks. * Nautilus: a file manager for GNOME. CourseNana.COM

Formatting Syntax CourseNana.COM

It is very common that command strings are written in a simple template language: characters are usually interpreted literally into themselves, but format specifiers, which are enclosed by parentheses, indicate the location and method to translate a piece of placeholder to characters. CourseNana.COM

In Simple Nautilus, the following formatting is used: CourseNana.COM

chown CourseNana.COM

Formatted arguments enclosed in sharp brackets < and > can be replaced by any single syntactically valid string.
Formatted arguments enclosed in square brackets
[ and ] can be replaced by zero or one syntactically valid string. CourseNana.COM

Example CourseNana.COM

A formatted string CourseNana.COM

can be extended by CourseNana.COM

<a>, <b>, <c> and [d] are extended to Never, " Gonna ", "Give You" and "up". or CourseNana.COM

<a> , <b> and <c> are extended to Among , Us , yo and [d] is omitted. CourseNana.COM

Permission and Ownership CourseNana.COM

Like in Unix, this system supports user and permission management. However, the concept of group is omitted and therefore the mode string for permission is shorted than its form in Unix. CourseNana.COM

To view the permissions for all files in a directory, use the ls command with the -l option. For example, if you enter: CourseNana.COM

You should see output similar to the following: CourseNana.COM

The first column indicates the file type and the permission information The second column indicates the owner of the file or directory.
The third column indicates the name of the file or directory.
CourseNana.COM

The first character in the first column indicates whether the listed object is a file or a directory. Directories are indicated by a ( d ); files are indicated by a dash ( - ), which is the absence of a d at the beginning of the first line. Then, there are two sets of three characters that represent different levels of ownership. Hence, myfile.txt is a file and Example is a directory. CourseNana.COM

The letters rwx represent different permission levels: CourseNana.COM

Permission Files Directories CourseNana.COM

r can read the file can ls the directory CourseNana.COM

For example, CourseNana.COM

drwxr-x : d being the first character indicates directory; the owner permissions are rwx , indicating that the owner can view, modify, and enter the directory; other (anyone other than the owner) can view as well as enter the directory. (Group is not defined, therefore there are no group permissions.) CourseNana.COM

-rw-r-- : - being the first character indicates file; the owner permissions are rw- , indicating that the owner can read and write to the file but can't execute it as a program; other (anyone other than the owner) can only read the file. (Again, group is not defined, therefore there are no group permissions.) CourseNana.COM

Default setting and lifetime CourseNana.COM

The default user upon starting the program is root with the initial working directory being the root directory ( / ). CourseNana.COM

Whenever the program starts, the initial effective user root and an empty virtual name space are created; whenever the program exits, the whole virtual user space and virtual name space are lost. CourseNana.COM

root user is the most powerful user in this system. When the current effective user is root , they can ignore all permission requirements stated below. In other words, root will face no CourseNana.COM

Prompt Formation CourseNana.COM

The input prompt should have the following formation, where the leading prompt is ended by a dollar symbol and a single white space: CourseNana.COM

White spaces that come after a valid command should be ignored. CourseNana.COM

If there are only whitespace characters being inputted by the user as a commond string, nothing will happen when the user executes this command. CourseNana.COM

Example CourseNana.COM

If user root is at path / , the prompt printed before any input should be: CourseNana.COM

If bob enter a command pwd , then the combination of the input and prompt forms the line: CourseNana.COM

Valid character set CourseNana.COM

User names, file names and directory names are valid when it only contains: CourseNana.COM

All alphanumeric characters, a to z, A to Z, and 0 to 9; the Space character, ;
the Hyphen character,
- ;
the Underscore character,
_ . CourseNana.COM

Special path dot CourseNana.COM

A dot component in a path refer to the preceding component. CourseNana.COM

For a path a/b/c/./d/. , the preceding component of the first (left-most) dot is a/b/c . The preceding component of the second (right-most) dot is a/b/c/./d , which shall evaluate to CourseNana.COM

a/b/c/d . The whole path shall evaluate to a/b/c/d . dot-dot CourseNana.COM

A dot-dot component in a path refer to the parent of the preceding component. That is, it moved up one level toward the root / . CourseNana.COM

For a path a/b/c/../d/.. , the preceding component of the first (left-most) dot-dot is a/b/c . The preceding component of the second (right-most) dot-dot is a/b/c/../d , which shall evaluate to CourseNana.COM

Example CourseNana.COM

Assume there exists a tree of directories /a/b/c/d/e , where a to e are valid directories. There are no other files or directories on the system. CourseNana.COM

Commands CourseNana.COM

Please note that all format string to be printed should be expended by the real parameter in- place. CourseNana.COM

exit CourseNana.COM

To quit the program. Print: CourseNana.COM

bye, <current_user> CourseNana.COM

pwd CourseNana.COM

Print name of current working virtual directory. CourseNana.COM

cd <dir> CourseNana.COM

Change the working directory to <dir> .
Require current effective user's execute bit
x on <dir> . If does not exist, print: CourseNana.COM

Implementation CourseNana.COM

The assignment is to be implemented in Python. A set of scaffold files will be provided. You are expected to write legible code with good style, e.g. PEP 8. CourseNana.COM

You are NOT allowed to import ANY Python modules. You are free to use all builtin functions of Python. If you want to use an additional module which will not trivialize the assignment, please ask on Ed. The allowed library list may be extended. Related announcement should be posted accordingly.  CourseNana.COM

e2e_tests/ CourseNana.COM

<name>.out CourseNana.COM

drwxr-x root .
bob:/$ ls -d -l /
drwxr-x root /
bob:/$ ls -l folder1
ls: Permission denied bob:/$ ls -l folder1/folder2 ls: Permission denied bob:/$ su
CourseNana.COM

root:/$ chmod o=x folder1 root:/$ su bob
bob:/$ ls -l folder1
ls: Permission denied
bob:/$ ls -l folder1/folder2 bob:/$ ls -a -l folder1/folder2 drwxr-x root .
CourseNana.COM

drwx--x root ..
bob:/$ ls -d -l folder1 drwx--x root folder1
bob:/$ ls -d -l folder1/folder2 drwxr-x root folder1/folder2 bob:/$ exit
bye, bob
CourseNana.COM

You must NOT create, access or delete any actual files on disk. You must NOT preserve any data temporarily or permanently in any actual files on disk, but the memory. CourseNana.COM

Please be mindful: breaching the above restrictions will result in harsh deduction for the entire assignment. CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
Australia代写,University of Sydney代写,Simple Nautilus代写,Python代写,Shell代写,Australia代编,University of Sydney代编,Simple Nautilus代编,Python代编,Shell代编,Australia代考,University of Sydney代考,Simple Nautilus代考,Python代考,Shell代考,Australiahelp,University of Sydneyhelp,Simple Nautilushelp,Pythonhelp,Shellhelp,Australia作业代写,University of Sydney作业代写,Simple Nautilus作业代写,Python作业代写,Shell作业代写,Australia编程代写,University of Sydney编程代写,Simple Nautilus编程代写,Python编程代写,Shell编程代写,Australiaprogramming help,University of Sydneyprogramming help,Simple Nautilusprogramming help,Pythonprogramming help,Shellprogramming help,Australiaassignment help,University of Sydneyassignment help,Simple Nautilusassignment help,Pythonassignment help,Shellassignment help,Australiasolution,University of Sydneysolution,Simple Nautilussolution,Pythonsolution,Shellsolution,