-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtext.c
61 lines (53 loc) · 1.11 KB
/
text.c
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
60
61
#include<stdio.h>
#include "axel.h"
/* For returning string values from functions */
static char string[MAX_STRING];
int main( int argc, char *argv[] )
{
char fn[MAX_STRING] = "";
int i, j, cur_head = 0;
conf_t conf[1];
axel_t *axel;
char *s;
s = malloc( MAX_STRING );
memset(s, 0, sizeof(s));
/*strcpy(s,"http://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.5/MySQL-5.5.16-1.linux2.6.x86_64.tar");
*/
/*strcpy(s,"http://bbs.chinaunix.net/forum.php?mod=attachment&aid=NTA3NTc0fDI3YmZjMmIzfDE0Mjc2MzE5MjV8MHwzNjAwOT"); */
strcpy(s,argv[1]);
if( !conf_init( conf ) )
{
return( 1 );
}
axel = axel_new( conf, 0, s );
if( *fn )
{
sprintf( string, "%s.st", fn );
}
else
{
/* Local file existence check */
i = 0;
s = axel->filename + strlen( axel->filename );
while( 1 )
{
sprintf( string, "%s.st", axel->filename );
if( access( axel->filename, F_OK ) == 0 )
{
if( axel->conn[0].supported )
{
if( access( string, F_OK ) == 0 )
break;
}
}
else
{
if( access( string, F_OK ) )
break;
}
sprintf( s, ".%i", i );
i ++;
}
}
return 0;
}