-
Notifications
You must be signed in to change notification settings - Fork 3
/
remember or die
59 lines (43 loc) · 1.13 KB
/
remember or die
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
C
----READ FROM DIRECTORY
DIR *folder;
struct dirent *entry;
folder = opendir(".");
while( (entry=readdir(folder))){/*fai l'informatica*/}
closedir(folder);
stat() ---> tutte le info sul file
----PIPE
int fd[2];
pipe(fd);
pid = fork();
if pid()
close(fd[0])
//informatica
write(fd[1],&variabile, sizeof(variabile))
close(fd[1])
else
close(fd[1])
//informatica
read(fd[0],&variabile, sizeof(variabile))
close(fd[0])
----READFILE
char *line=NULL;
size_t size=0;
while(getline(&line, &size, file) !=-1)
free(line)
char *fgets(line, 100 /*caratteri da leggere*/, FILE *stream)
----STRING
strtok(char *riga, separatore)
strtok(NULL, separatore) //legge di lì in avanti
----TIME
utime modifica tempo di accesso/modifica
---PATH
char *realpath(const char *path, char *resolved_path);
symlink(const char *file, const char *linkname)
PY
----READ FROM DIRECTORY
for entry in os.scandir(dir):
entry.*
----THREAD
x = threading.Thread(target=execute, args=(elem,))
x.start()