mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.0 KiB
2.0 KiB
raid3
Instructions
This raid is based on the raid1
functions.
Create a program raid3
that takes a string
as an argument and displays the name of the matching raid1
and its dimensions.
-
If the argument is not a
raid1
the program should printNot a Raid function
. -
All answers must end with a newline (
'\n'
). -
If there is more than one
raid1
matches, the program must display them all alphabetically ordered and separated by a||
.
Usage
- If it's
radi1a
student@ubuntu:~/piscine-go/raid3$ ls -l
-rw-r--r-- 1 student student nov 23 14:30 raid3.go
-rwxr-xr-x 1 student student nov 23 19:18 raid3
-rwxr-xr-x 1 student student nov 23 19:50 raid1a
drwxr-xr-x 2 student student nov 23 19:02 raid1aProg
-rwxr-xr-x 1 student student nov 23 19:50 raid1b
drwxr-xr-x 2 student student nov 22 23:36 raid1bProg
-rwxr-xr-x 1 student student nov 23 19:50 raid1c
drwxr-xr-x 2 student student nov 23 19:02 raid1cProg
-rwxr-xr-x 1 student student nov 23 19:50 raid1d
drwxr-xr-x 2 student student nov 23 00:40 raid1dProg
-rwxr-xr-x 1 student student nov 23 19:50 raid1e
drwxr-xr-x 2 student student nov 23 19:02 raid1eProg
student@ubuntu:~/piscine-go/raid3$ ./raid1a 3 3 | ./raid3
[raid1a] [3] [3]
student@ubuntu:~/piscine-go/raid3$
student@ubuntu:~/piscine-go/raid3$
student@ubuntu:~/piscine-go/raid3$
student@ubuntu:~/piscine-go/raid3$
- If it's
raidc 1 1
:
student@ubuntu:~/piscine-go/raid3$ ./raid1c 1 1
A
student@ubuntu:~/piscine-go/raid3$ ./raid1d 1 1
A
student@ubuntu:~/piscine-go/raid3$ ./raid1e 1 1
A
student@ubuntu:~/piscine-go/raid3$ ./raid1c 1 1 | ./raid3
[raid1c] [2] [1] || [raid1d] [2] [1] || [raid1e] [2] [1]
student@ubuntu:~/piscine-go/raid3$
- If it's
raidc 1 2
:
student@ubuntu:~/piscine-go/raid3$ ./raid1e 1 2
A
C
student@ubuntu:~/piscine-go/raid3$ ./raid1c 1 2
A
C
student@ubuntu:~/piscine-go/raid3$ ./raid1e 1 2 | ./raid3
[raid1c] [1] [2] || [raid1e] [1] [2]
student@ubuntu:~/piscine-go/raid3$