Return to Operationg Systems home
Produce the following tree of directories in your home directory:
osEx01 | ------------------------ | | | src bin test | | ---------- ----------- | | | | include lib script results
src, then, using the directory
srcas the current directory, copy the file in the directories
results(to this extent use only absolute paths).
catto verify the content of the files.
diffto verify that all the files have the same content.
Executing all the commands from the root of your user (i.e.,
/home/username), do the following:
osEx01into a directory tree named
osEx01backup, by using the command
cpto copy individual files and the command
osEx01by using the command
rmto remove individual files and the command
Check what they do and for what the following commands are used:
For any problem, remember that you can use the following command to obtain an online help manual for a specific
Verify and reply to the following questions:
groupto which you belong.
/homedirectory (e.g., its subdirectories, etc.)
How is it possible to modify in the same way the access rights to all the files and directories of a directory tree (for example, to eliminate the read right to all, user, group, and other of the directory
lab01e03in.slfile have a different size than the others, but it has the same content?
lab01e03in.txtwith a text editor of your choice
lab01e03in.backupwith the content of the files
lab01e03in.sl. Why in the second case do you obtain an error message?
allows to update date and time of the last modification performed on a file.
In the case the specified file does not exist, it creates an empty file with that name.
Perform the following tasks using:
gcccompiler (alternatively use an IDE of your choice, e.g., CodeBlocks).
Write a C language program that, using the ANSI C I/O primitives (
fputs of your choice), is able to copy a text file to an identical file.
The name of the two files is received on the command line, so that the program can be executed using a command that specifies three parameters:
nameExcutable sourceFile destinationFile
Compile the source files using
destinationFilemust be identic) using the shell command
How does the written program behave if you try to copy a binary file?
Change the program using
fwritefunctions (optional) and then
closePOSIX system calls.
installtarget, which allows to
cleantarget, which removes the object file in the current directory
distcleantarget that calls the
cleantarget and deletes the
bindirectory (which is the sibling of the current directory) and all its content
Take as reference the example analyzed in classroom: Makefile4