Version: 2
Навигатор по разделам:
| Summary: This project is the discovery in detail and by programming of a UNIX mechanism that you already know.
| Описание: Этот проект представляет собой детальное и программное открытие механизма UNIX, который вы уже знаете. | | --- | --- |
| • Your project must be written in accordance with the Norm. If you have bonus files/functions, they are included in the norm check and you will receive a 0 if there
| is a norm error inside. | Ваш проект должен быть написан в соответствии с Нормой. Если у вас есть бонусные файлы / функции, они включаются в проверку нормы, и вы получите 0, если внутри есть ошибка нормы. |
|---|---|
| • Your functions should not quit unexpectedly (segmentation fault, bus error, double | |
| free, etc) apart from undefined behaviors. If this happens, your project will be | |
| considered non functional and will receive a 0 during the evaluation. |
| Ваши функции не должны завершаться неожиданно (ошибка сегментации, ошибка шины, двойное освобождение и т. д.), за исключением неопределенного поведения. Если это произойдет, ваш проект будет считаться неработоспособным и получит 0 баллов при оценке. | | • All heap allocated memory space must be properly freed when necessary. No leaks will be tolerated.
| При необходимости все пространство памяти, выделенное в куче, должно быть правильно освобождено. Никаких утечек не допустимо. | | • If the subject requires it, you must submit a Makefile which will compile your source files to the required output with the flags -Wall, -Wextra and -Werror, use cc, and your Makefile must not relink.
| Если тема требует этого, вы должны отправить Makefile, который скомпилирует ваши исходные файлы в требуемый результат с флагами -Wall, -Wextra и -Werror, используйте cc, и ваш Makefile не должен перелинковываться. |
| • Your Makefile must at least contain the rules $(NAME), all, clean, fclean and
re. | Ваш Makefile должен содержать как минимум правила $ (NAME), all, clean, fclean и re. |
| • To turn in bonuses to your project, you must include a rule bonus to your Makefile,
which will add all the various headers, librairies or functions that are forbidden on
the main part of the project. Bonuses must be in a different file _bonus.{c/h}.
Mandatory and bonus part evaluation is done separately. | Чтобы превратить бонусы в свой проект, вы должны включить бонус правила в свой Makefile, который добавит все различные заголовки, библиотеки или функции, запрещенные в основной части проекта. Бонусы должны быть в другом файле _bonus. {C / h}. Оценка обязательной и бонусной части проводится отдельно. |
| • If your project allows you to use your libft, you must copy its sources and its
associated Makefile in a libft folder with its associated Makefile. Your project’s
Makefile must compile the library by using its Makefile, then compile the project.
| Если ваш проект позволяет вам использовать ваш libft, вы должны скопировать его исходники и связанный с ним файл Makefile в папку libft с соответствующим файлом Makefile. Makefile вашего проекта должен скомпилировать библиотеку с помощью Makefile, а затем скомпилировать проект. | | • We encourage you to create test programs for your project even though this work won’t have to be submitted and won’t be graded. It will give you a chance to easily test your work and your peers’ work. You will find those tests especially useful during your defence. Indeed, during defence, you are free to use your tests and/or the tests of the peer you are evaluating.
| Мы рекомендуем вам создать тестовые программы для вашего проекта, даже если эту работу не нужно будет отправлять и она не будет оцениваться. Это даст вам возможность легко проверить свою работу и работу ваших коллег. Вы найдете эти тесты особенно полезными во время вашей защиты. Действительно, во время защиты вы можете использовать свои тесты и/или тесты коллеги, которого вы оцениваете. | | • Submit your work to your assigned git repository. Only the work in the git reposi- tory will be graded. If Deepthought is assigned to grade your work, it will be done after your peer-evaluations. If an error happens in any section of your work during Deepthought’s grading, the evaluation will stop. | Отправьте свою работу в назначенный репозиторий git. Оцениваться будет только работа в репозитории git. Если DeepThreadt назначен для оценки вашей работы, это будет сделано после ваших оценок коллег. Если во время выставления оценок Deepoughtt в каком-либо разделе вашей работы произойдет ошибка, оценка будет остановлена. |
| • The executable file must be named pipex.
| • Исполняемый файл должен называться pipex. |
| --- | --- |
| You have to turn in a Makefile which will compile your source files. It must not relink. | Вы должны включить Makefile, который скомпилирует ваши исходные файлы. Это не должно пересвязать. |
| • You have to handle errors sensitively. In no way can your program quit unexpectedly
(Segmentation fault, bus error, double free, etc). If you are unsure, handle the errors
like the shell command < file1 cmd1 | cmd2 > file2.
| Вы должны чутко относиться к ошибкам. Ни в коем случае ваша программа не может неожиданно завершиться (ошибка сегментации, ошибка шины, двойное освобождение и т. д.). Если вы не уверены, обработайте ошибки, например, команду оболочки < file1 cmd1 | cmd2 > file2. |
| • Your program cannot have memory leaks.
| В вашей программе не должно быть утечек памяти. | | • You are allowed to use the following functions:
| Вам разрешено использовать следующие функции: |
◦ access ◦ open ◦ unlink ◦ close ◦ read ◦ write ◦ malloc ◦ waitpid ◦ wait ◦ free ◦ pipe ◦ dup ◦ dup2 ◦ execve ◦ fork ◦ perror ◦ strerror ◦ exit
| Your objective is to code the Pipex program. | Ваша цель — закодировать программу Pipex. |
|---|---|
| It should be executed in this way: | Это должно быть выполнено таким образом: |
$> ./pipex file1 cmd1 cmd2 file2
| Just in case: file1 and file2 are file names, cmd1 and cmd2 are shell commands with their parameters. | На всякий случай: файл1 и файл2 — имена файлов, cmd1 и cmd2 — команды оболочки со своими параметрами. |
|---|---|
| The execution of the pipex program should do the same as the next shell command: | Выполнение программы pipex должно выполняться так же, как и следующая команда оболочки: |
$> < file1 cmd1 | cmd2 > file2
$> ./pipex infile ``ls -l'' ``wc -l'' outfile