debut TP1
This commit is contained in:
parent
3f3cacd727
commit
963fe86c78
10
2020-2021/S3T_TP_01_SGF-1/Makefile
Executable file
10
2020-2021/S3T_TP_01_SGF-1/Makefile
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
CFLAGS = -Wall -std=gnu99 -g
|
||||||
|
|
||||||
|
EXECUTABLES = demo \
|
||||||
|
myls
|
||||||
|
|
||||||
|
all : ${EXECUTABLES}
|
||||||
|
|
||||||
|
clean :
|
||||||
|
@rm -f core *.o *.out *~
|
||||||
|
@rm -f ${EXECUTABLES}
|
19
2020-2021/S3T_TP_01_SGF-1/demo.c
Executable file
19
2020-2021/S3T_TP_01_SGF-1/demo.c
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
/// M311 - Demonstration de base
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
int main (int argc, char* argv[])
|
||||||
|
{
|
||||||
|
int resultat;
|
||||||
|
if (argc != 2)
|
||||||
|
{ fprintf (stderr, "Syntaxe : %s <nom>\n\n", argv[0]); exit (1); }
|
||||||
|
|
||||||
|
if ((resultat = mkdir (argv[1], 0777)) == -1)
|
||||||
|
{ perror ("Echec mkdir"); exit (2); }
|
||||||
|
|
||||||
|
/// ...
|
||||||
|
}
|
8
2020-2021/S3T_TP_01_SGF-1/myls.c
Executable file
8
2020-2021/S3T_TP_01_SGF-1/myls.c
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
/// M311 - myls
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main (int argc, char* argv[])
|
||||||
|
{
|
||||||
|
/// ...
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user