Skip to content

Copy files and directories, just like the `cp` command in Linux, but simpler using C language.

Notifications You must be signed in to change notification settings

iamhslee/copyfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

copyfile

2024-1 Operating Systems (ITP30002) - HW #1

A homework assignment to copy files and directories, just like the cp command in Linux, but simpler using C language.

Author

Hyunseo Lee (22100600) [email protected]

1. How to build

This program is written in C language on Ubuntu 22.04.1 LTS. To build this program, you need to use Ubuntu 22.04.1 LTS with GCC and Make installed.

After unarchiving the folder, you should see the following files:

$ ls
Makefile  README.md  main.c

To build the program, run the following command in the terminal:

$ make

To build the program with debug mode, run the following command in the terminal:

$ make debug

To cleanup the build files and test files, run the following command in the terminal:

$ make clean

You can also generate the test files by running the following command in the terminal:

$ make testenv

2. Usage

To run the program, run the following command in the terminal:

$ ./copyfile <Options>

copyfile supports the following options:

2-1. Copy source file to target file

$ ./copyfile -f <Source File> <Target File>

2-2. Copy multiple source files to target directory

$ ./copyfile -m <Source File 1> <Source File 2> ... <Source File N> <Target Directory>

2-3. Copy all files and directories from source directory to target directory

$ ./copyfile -d <Source Directory> <Target Directory>

2-4. Verbose mode

You can use verbose mode with each option by adding v option at the end of the command. For example:

# Copy source file to target file with verbose mode
$ ./copyfile -fv <Source File> <Target File>

# Copy multiple source files to target directory with verbose mode
$ ./copyfile -mv <Source File 1> <Source File 2> ... <Source File N> <Target Directory>

# Copy all files and directories from source directory to target directory with verbose mode
$ ./copyfile -dv <Source Directory> <Target Directory>

You can also see the usage explained above by running the following command in the terminal:

$ ./copyfile -h

About

Copy files and directories, just like the `cp` command in Linux, but simpler using C language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published