-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate.c
More file actions
42 lines (31 loc) · 742 Bytes
/
create.c
File metadata and controls
42 lines (31 loc) · 742 Bytes
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
#include<stdio.h>
#include<stdlib.h>
#include "hashtable.h"
int main()
{
FILE* fd= fopen("metadata.dat","w+");
int zero=0;
fseek(fd,0,SEEK_SET);
fwrite(&zero,sizeof(int),1,fd);
fseek(fd,sizeof(int),SEEK_SET);
fwrite(&zero,sizeof(int),1,fd);
fseek(fd,2*sizeof(int),SEEK_SET);
fwrite(&zero,sizeof(int),1,fd);
fclose(fd);
htdisk = fopen("ht_disk.dat", "w+");
int i=0;
entry_t init_node;
for (i=0;i< FIXED_TABLESIZE;i++)
{
fseek(htdisk,i*sizeof(entry_t),SEEK_SET);
fread(&init_node, sizeof(entry_t),1,htdisk);
init_node.not_empty = 0;
}
fclose(htdisk);
tree_ptr = create_tree();
fd= fopen("C_source_path.txt","w+");
fclose(fd);
fd= fopen("file.txt","w+");
fclose(fd);
return 0;
}