Subversion Repositories Kolibri OS

Rev

Rev 6857 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6857 Rev 8827
Line 1... Line 1...
1
int cmd_touch(char file[])
1
int cmd_touch(char file[])
2
{
2
{
3
 
-
 
4
kol_struct70	k70;
3
	kol_struct70	k70;
5
char		temp[FILENAME_MAX];
4
	char		temp[FILENAME_MAX];
6
unsigned	result;
5
	unsigned	result;
Line 7... Line 6...
7
 
6
 
8
if (NULL == file || strlen(file) == 0)
-
 
9
	{
-
 
10
	#if LANG_ENG
7
	if (NULL == file || strlen(file) == 0) {
11
		printf("  touch \n\r");
-
 
12
	#elif LANG_RUS
-
 
13
		printf("  touch <¨¬ï ä ©« >\n\r");
-
 
14
	#endif
8
		printf(CMD_TOUCH_USAGE);
15
	return TRUE;
9
		return TRUE;
Line 16... Line 10...
16
	}
10
	}
17
 
-
 
18
if (  ( 0 == strcmp(file, ".") ) || ( 0 == strcmp(file, "..") ) || ( 0 == strcmp(cur_dir, "/")) ) 
11
 
19
	{
12
	if (  ( 0 == strcmp(file, ".") ) || ( 0 == strcmp(file, "..") ) || ( 0 == strcmp(cur_dir, "/")) )  {
Line 20... Line 13...
20
	return FALSE;
13
		return FALSE;
21
	}
-
 
22
 
14
	}
Line 23... Line 15...
23
if ( '/' == file[0])
15
 
24
	{
16
	if ( '/' == file[0]) {
25
	strcpy(temp, file);
17
		strcpy(temp, file);
26
 
18
 
27
	if ( !file_check(temp) )
-
 
28
		k70.p00 = 2;
19
		if ( !file_check(temp) )
29
	else
-
 
30
		k70.p00 = 3;
20
			k70.p00 = 2;
31
	}
21
		else
32
else 
22
			k70.p00 = 3;
33
	{
23
	} else {
34
	strcpy(temp, cur_dir);
24
		strcpy(temp, cur_dir);