北美代写essay,程序代写,Java代写代做,Java代考-焦点论文

1. centre

Write a standard unix filter, which processes its standard input if there are no filename arguments, or processes a sequence of one or more file names on the command-line.

The transformation on the data is that each line is centred: it is preceded in the output by the appropriate number of spaces so as to centre the line in a specified width.

Call your program "centre" (source code filename "centre.c"). The "centre" program takes two options:

  • ?w specifies the width to be centred within, which is 80 characters by default. The ?w option takes an integer argument. You may limit this width (minimum or maximum) to avoid implementation difficulties, although the maximum must be at least 500. (Any specified value outside the minimum must result in an error message, not in incorrect behaviour.)
  • ?c has an argument which is a single character; this character is used instead of space, on both sides of the input line, to achieve the desired width of each line. That is to say, "?c?'?'" is different from the default in that this puts spaces on the right side of the input line as well as the left; without ?c, the filler characters appear only on the left.

You must parse the command-line options with getopt() so as to accommodate all standard allowable command-line variations. There is an example getopt()-using program in the "Course notes" section of the CSC 209 web site, also linked to from the Q&A page.

When a file cannot be opened, you must call perror() properly to output a standard error message.

2. vcut

Write the?vcut?program, which is a vertical version of?cut.?vcut?takes a description similar to cut's ?c option argument, but instead of referring to characters horizontally within a line, it refers to line numbers (vertical).

For example, "vcut?8,1-4,9" takes lines 1, 2, 3, 4, 8, and 9 of the input (order on the command-line doesn't matter). The rest of the input is discarded.

北美代写essay,程序代写,Java代写代做,Java代考-焦点论文 The specification as to which lines are included is a mandatory first argument. The program processes the standard input if there are no further arguments, or it processes one or more file names if there are further arguments. You do not need to use getopt().

北美代写essay,程序代写,Java代写代做,Java代考-焦点论文 Please see some substantial guidance about a simplified way to parse and deal with the specification argument at?. That simpler algorithm limits line numbers in the specification to be less than 100, which is fine for this assignment.

3. "find ?name"

Write a standard unix tool in C which is like "find ?name": it recursively traverses one or more directories, looking for a file with the exact specified name (not a substring). It outputs an appropriate path name for each match.

Call your program "findname". It will not take any command-line options, so you do not need to use getopt(). The first argument is the file name to look for, and subsequent arguments (of which there must be at least one) are directory names to search. Unlike the real?find, wildcard characters (glob notation) are not interpreted in the file name search argument.

The exit status should be 0, 1, or 2, with the same meanings as in?grep.

findname should?not?do a chdir() (which you might be tempted to do to avoid string processing). If it does a chdir(), your program will no longer always work with multiple directory arguments, since a chdir() in processing the first directory may invalidate the name of the specified second directory.

You may assume a maximum likely complete path name of, say, 2000 characters, so long as your program aborts with an error, rather than exceeding array bounds, should the situation turn out to be more complex than this.

You may not use ftw(), fts(), nftw(), or similar library functions (the point of this assignment question is to?implement?the filesystem-tree traversal).

Other notes

Please try sample implementations in /u/csc209h/summer/pub/a2 (compiled programs only, so that you can't see my sample solution source code before the due date!).

北美代写essay,程序代写,Java代写代做,Java代考-焦点论文 All of your programs must be in standard C. They must compile on the teach.cs linux machines with "gcc??Wall" with no errors or warning messages, and may not use linux-specific or GNU-specific features.

Pay attention to process exit statuses. Your programs must return exit status 0 or 1 as appropriate (or sometimes 2 in the case of findname).

Call your assignment files centre.c, vcut.c, and findname.c. Your files must have the correct names so as to be processed correctly by the grading software, and auxiliary files are not permitted. Submit with commands such as

	submit ?c csc209h ?a a2 centre.c vcut.c findname.c
and the other 'submit' commands are as in assignment one and the labs.

Please see the assignment Q&A web page at??for other reminders, and answers to common questions.

Remember:

This assignment is due at the end of Friday, July 10, by midnight. Late assignments are not ordinarily accepted, and?always?require a written explanation. If you are not finished your assignment by the submission deadline, you should just submit what you have, for partial marks.

Despite the above, I'd like to be clear that if there?is北美代写essay,程序代写,Java代写代做,Java代考-焦点论文?a legitimate reason for lateness, please do submit your assignment late and send me that written explanation.

北美代写essay,程序代写,Java代写代做,Java代考-焦点论文 And above all: Do not commit an academic offence. Your work must be your own. Do not look at other students' assignments, and do not show your assignment (complete or partial) to other students. Collaborate with other students only on material which is not being submitted for course credit.


在線客服

售前咨詢
售后咨詢
微信號
Essay_Cheery
微信
澳大利亚essay代写,编程代写,代码代写,程序代写-三洋编程 加拿大essay代写|程序代写代做||Python代写|Matlab代写-Meeloun 澳大利亚代写,代写essay,代写毕业论文,留学生代写-小马代写 日本代写,北美作业代写,新加坡代写,essay代写-无时差服务 加拿大代写,作业代写,exam代考,Report代写,代写文章-最靠谱最低价 新加坡代写,北美CS代写,python代写,CS编程代写-新顾客立减20% 加拿大essay代写,paper代写,Homework代写-致远教育 新西兰代写,代写论文,paper代写,Essay代寫,代做功課-浩天教育 美国论文代写,essay代写,留学生作业代做-留学写作网 马来西亚代写,essay代写,留学生网课代修代考,论文代写-小精灵代写