Subversion Repositories Kolibri OS

Rev

Rev 984 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1415 leency 1
//CODED by Veliant, Leency. GNU GPL licence.
975 leency 2
 
938 leency 3
struct f70{
4
	dword	func;
5
	dword	param1;
6
	dword	param2;
7
	dword	param3;
8
	dword	param4;
9
	char	rezerv;
10
	dword	name;
11
};
12
 
975 leency 13
struct BDVK{
14
	dword	attr;
15
	byte	type_name;
16
	byte	rez1, rez2, rez3;
17
	dword	timecreate;
18
	dword	datecreate;
19
	dword	timelastaccess;
20
	dword	datelastaccess;
21
	dword	timelastedit;
22
	dword	datelastedit;
23
	dword	sizelo;
24
	dword	sizehi;
25
	char	name[518];
26
};
27
 
944 leency 28
////////////////////////////
1415 leency 29
//     ірочитать файл     //
944 leency 30
////////////////////////////
31
f70 read_file_70;
32
void ReadFile(dword pos, file_size, read_buffer, file_path)
33
{
34
	read_file_70.func = 0;
35
	read_file_70.param1 = pos;
36
	read_file_70.param2 = 0;
37
	read_file_70.param3 = file_size;
38
	read_file_70.param4 = read_buffer;
39
	read_file_70.rezerv = 0;
40
	read_file_70.name = file_path;
41
	$mov eax,70
42
	$mov ebx,#read_file_70.func
43
	$int 0x40
44
}
938 leency 45
 
46
///////////////////////////
1415 leency 47
//    ірочитать папку    //
944 leency 48
///////////////////////////
49
f70 read_dir_70;
50
void ReadDir(dword file_count, read_buffer, read_dir_path)
51
{
52
	read_dir_70.func = 1;
53
	read_dir_70.param1 = 0;
54
	read_dir_70.param2 = 0;
55
	read_dir_70.param3 = file_count;
56
	read_dir_70.param4 = read_buffer;
57
	read_dir_70.rezerv = 0;
58
	read_dir_70.name = read_dir_path;
59
	$mov eax,70
60
	$mov ebx,#read_dir_70.func
61
	$int 0x40
62
}
63
 
64
///////////////////////////
1415 leency 65
//   іапуск программv    //
938 leency 66
///////////////////////////
67
f70 run_file_70;
68
void RunProgram(dword run_path, run_param)
69
{
70
    run_file_70.func = 7;
71
    run_file_70.param1 =
72
    run_file_70.param3 =
73
    run_file_70.param4 =
74
    run_file_70.rezerv = 0;
75
    run_file_70.param2 = run_param;
76
    run_file_70.name = run_path;
77
    $mov eax,70
78
    $mov ebx,#run_file_70.func
79
    $int 0x40
80
}
81
 
82
///////////////////////////
1415 leency 83
//    Tоздание папки     //
938 leency 84
///////////////////////////
85
f70 create_dir_70;
86
void CreateFolder(dword new_folder_path)
87
{
88
	create_dir_70.func = 9;
89
	create_dir_70.param1 =
90
	create_dir_70.param2 =
91
	create_dir_70.param3 =
92
	create_dir_70.param4 =
93
	create_dir_70.rezerv = 0;
94
	create_dir_70.name = new_folder_path;
95
	$mov eax,70
96
	$mov ebx,#create_dir_70.func
97
	$int 0x40
98
}
99
 
100
////////////////////////////
1415 leency 101
//  Lдаление файла/папки  //
938 leency 102
////////////////////////////
103
f70 del_file_70;
104
void DeleleFile(dword del_file_path)
105
{
106
	del_file_70.func = 8;
107
	del_file_70.param1 =
108
	del_file_70.param2 =
109
	del_file_70.param3 =
110
	del_file_70.param4 =
111
	del_file_70.rezerv = 0;
112
	del_file_70.name = del_file_path;
113
	$mov eax,70
114
	$mov ebx,#del_file_70.func
115
	$int 0x40
116
}
117
 
118
///////////////////////////
1415 leency 119
//   Tкопировать файл    //
938 leency 120
///////////////////////////
121
f70	CopyFile_f;
122
inline fastcall dword CopyFile(dword EBX,ECX)
123
{
124
	BDVK CopyFile_atr;
125
	dword s=EBX, d=ECX, cBufer=0;
126
	CopyFile_f.func = 5;
127
	CopyFile_f.param1 = 0;
128
	CopyFile_f.param2 = 0;
129
	CopyFile_f.param3 = 0;
130
	CopyFile_f.param4 = #CopyFile_atr;
131
	CopyFile_f.rezerv = 0;
132
	CopyFile_f.name = s;
133
	$mov eax, 70
134
	$mov ebx, #CopyFile_f
135
	$int 0x40
136
 
137
	if (!EAX)
138
	{
984 leency 139
		cBufer = malloc(2*CopyFile_atr.sizelo);
944 leency 140
		ReadFile(dword 0, CopyFile_atr.sizelo, cBufer, s);
938 leency 141
 
142
		IF (!EAX)
143
		{
144
			CopyFile_f.func = 2;
145
			CopyFile_f.param1 = 0;
146
			CopyFile_f.param2 = 0;
147
			CopyFile_f.param3 = CopyFile_atr.sizelo;
148
			CopyFile_f.param4 = cBufer;
149
			CopyFile_f.rezerv = 0;
150
			CopyFile_f.name = d;
151
			$mov eax, 70
152
			$mov ebx, #CopyFile_f
153
			$int 0x40
154
		}
155
	}
156
 
157
}
158