Rev 5803 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5803 | Rev 6251 | ||
---|---|---|---|
Line 195... | Line 195... | ||
195 | $mov eax,70 |
195 | $mov eax,70 |
196 | $mov ebx,#read_dir_70.func |
196 | $mov ebx,#read_dir_70.func |
197 | $int 0x40 |
197 | $int 0x40 |
198 | } |
198 | } |
Line 199... | Line 199... | ||
199 | 199 | ||
200 | :char isdir(dword fpath) |
200 | :char dir_exists(dword fpath) |
201 | { |
201 | { |
202 | BDVK fpath_atr; |
202 | BDVK fpath_atr; |
203 | GetFileInfo(fpath, #fpath_atr); |
203 | GetFileInfo(fpath, #fpath_atr); |
204 | return fpath_atr.isfolder; |
204 | return fpath_atr.isfolder; |
- | 205 | } |
|
- | 206 | :char file_exists(dword fpath) |
|
- | 207 | { |
|
- | 208 | BDVK ReadFile_atr; |
|
- | 209 | if (! GetFileInfo(fpath, #ReadFile_atr)) return true; |
|
- | 210 | return false; |
|
- | 211 | } |
|
Line 205... | Line 212... | ||
205 | } |
212 | |
206 | 213 | ||
- | 214 | :int GetFile(dword buf, filesize, read_path) |
|
207 | :int GetFile(dword buf, filesize, read_path) |
215 | { |
208 | { |
216 | int return_val = 0; |
209 | BDVK ReadFile_atr; |
217 | BDVK ReadFile_atr; |
210 | dword rBuf; |
218 | dword rBuf; |
211 | if (! GetFileInfo(read_path, #ReadFile_atr)) |
219 | if (! GetFileInfo(read_path, #ReadFile_atr)) |
212 | { |
220 | { |
213 | rBuf = malloc(ReadFile_atr.sizelo); |
221 | rBuf = malloc(ReadFile_atr.sizelo); |
214 | if (! ReadFile(0, ReadFile_atr.sizelo, rBuf, read_path)) |
222 | if (! ReadFile(0, ReadFile_atr.sizelo, rBuf, read_path)) |
215 | { |
223 | { |
216 | ESDWORD[buf] = rBuf; |
224 | ESDWORD[buf] = rBuf; |
217 | ESDWORD[filesize] = ReadFile_atr.sizelo; |
225 | ESDWORD[filesize] = ReadFile_atr.sizelo; |
218 | return 1; |
226 | return_val = 1; |
219 | } |
227 | } |
220 | } |
228 | } |
221 | free(rBuf); |
229 | free(rBuf); |
Line 222... | Line 230... | ||
222 | return 0; |
230 | return return_val; |
223 | } |
231 | } |
224 | 232 |