Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8075 | superturbo | 1 | /* turbocat2001 */ |
2 | #if LANG_ENG |
||
3 | #define HELP "info |
||
4 | #define FILE_NOT_FOUND "Object '%s' not found!\n" |
||
5 | #define OBJECT_INFO "Object '%s' information:\n\n" |
||
6 | #define TYPE "Type: " |
||
7 | #define DIR "'Folder'" |
||
8 | #define PART "'Part'" |
||
9 | #define FILE "'File'" |
||
10 | #define CREATED "Created: %02d.%02d.%02d %02d:%02d:%02d\n" |
||
11 | #define MODIFID "Modified: %02d.%02d.%02d %02d:%02d:%02d\n" |
||
12 | #define DATE_TIME " Date Time\n" |
||
13 | #define ATTRIB "Attributes: " |
||
14 | #define RO "'Read only' " |
||
15 | #define HIDDEN "'Hidden' " |
||
16 | #define SYS "'System' " |
||
17 | #define NOT_ARCHIV "'Not archived' " |
||
18 | #define FILE_SIZE "\nFile size: %u KB (%u B)\n" |
||
19 | |||
20 | #elif LANG_RUS |
||
21 | #define HELP "info <имя_объекта>\n" |
||
22 | #define FILE_NOT_FOUND "Объект '%s' не найден!\n" |
||
23 | #define OBJECT_INFO "Информация об объекте '%s':\n\n" |
||
24 | #define TYPE "Тип: " |
||
25 | #define DIR "'Папка'" |
||
26 | #define PART "'Том'" |
||
27 | #define FILE "'Файл'" |
||
28 | #define CREATED "Создан: %02d.%02d.%02d %02d:%02d:%02d\n" |
||
29 | #define MODIFID "Изменён: %02d.%02d.%02d %02d:%02d:%02d\n" |
||
30 | #define DATE_TIME " Дата Время\n" |
||
31 | #define ATTRIB "Атрибуты: " |
||
32 | #define RO "'Только для чтения' " |
||
33 | #define HIDDEN "'Скрытый' " |
||
34 | #define SYS "'Системный' " |
||
35 | #define NOT_ARCHIV "'Не архивный' " |
||
36 | #define FILE_SIZE "\nРазмер файла: %u KБ (%u Б)\n" |
||
37 | #endif |
||
38 | |||
39 | |||
40 | int cmd_info(char param[]) |
||
41 | { |
||
42 | byte is_dir=0, is_part=0; // Folder or part? |
||
43 | char* argv[100]; |
||
44 | if(1 != parameters_prepare(param, argv)) //get number of parameters |
||
45 | { |
||
46 | printf(HELP); |
||
47 | return TRUE; |
||
48 | } |
||
49 | |||
50 | FS_struct_BDVK *info=NULL; // BDVK struct define |
||
51 | info=get_bdvk(argv[0]); // Get file info (BDVK) |
||
52 | if(info==NULL) |
||
53 | { |
||
54 | printf(FILE_NOT_FOUND, argv[0]); |
||
55 | return TRUE; |
||
56 | } |
||
57 | printf(OBJECT_INFO, argv[0]); |
||
58 | |||
59 | printf(TYPE); |
||
60 | if (info->attrib & (1 << 4)) |
||
61 | { |
||
62 | printf(DIR); |
||
63 | is_dir=1; |
||
64 | } |
||
65 | else if (info->attrib & (1 << 3)) |
||
66 | { |
||
67 | printf(PART); |
||
68 | is_part=1; |
||
69 | } |
||
70 | else |
||
71 | { |
||
72 | printf(FILE); |
||
73 | } |
||
74 | printf("\n\n"); |
||
75 | printf(DATE_TIME); // Show date and time |
||
76 | printf(CREATED, info->c_date.d, info->c_date.m, info->c_date.y, info->c_time.h, info->c_time.m, info->c_time.s); |
||
77 | printf(MODIFID, info->m_date.d, info->m_date.m, info->m_date.y, info->m_time.h, info->m_time.m, info->m_time.s); |
||
78 | printf("\n"); |
||
79 | printf(ATTRIB); // Show Attributes |
||
80 | |||
81 | if (info->attrib & (1 << 0)) |
||
82 | { |
||
83 | printf(RO); |
||
84 | } |
||
85 | if (info->attrib & (1 << 1)) |
||
86 | { |
||
87 | printf(HIDDEN); |
||
88 | } |
||
89 | if (info->attrib & (1 << 2)) |
||
90 | { |
||
91 | printf(SYS); |
||
92 | } |
||
93 | |||
94 | if (info->attrib & (1 << 5)) |
||
95 | { |
||
96 | printf(NOT_ARCHIV); |
||
97 | } |
||
98 | |||
99 | printf("\n"); |
||
100 | |||
101 | if (!is_dir && (info->size)>=0 && !is_part) // If dir or part then not show file size |
||
102 | { |
||
103 | printf(FILE_SIZE, info->size/1024, info->size); |
||
104 | } |
||
105 | return TRUE; |
||
106 | }><>><>><>><>><>><>имя_объекта> |