ReactOS 0.4.15-dev-7788-g1ad9096
fatten.c File Reference
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
#include "fatfs/ff.h"
#include "fatfs/diskio.h"
Include dependency graph for fatten.c:

Go to the source code of this file.

Macros

#define PRINT_HELP_AND_QUIT()
 
#define NEED_PARAMS(_min_, _max_)
 
#define NEED_MOUNT()
 
#define FAT_VOL_LABEL_LEN   11
 
#define FAT16_HEADER_START   3
 
#define FAT16_HEADER_END   62
 

Functions

DWORD get_fattime (void)
 
void print_help (const char *name)
 
int is_command (const char *parg)
 
int need_mount (void)
 
int main (int oargc, char *oargv[])
 

Variables

static FATFS g_Filesystem
 
static int isMounted = 0
 
static unsigned char buff [32768]
 

Macro Definition Documentation

◆ FAT16_HEADER_END

#define FAT16_HEADER_END   62

◆ FAT16_HEADER_START

#define FAT16_HEADER_START   3

◆ FAT_VOL_LABEL_LEN

#define FAT_VOL_LABEL_LEN   11

◆ NEED_MOUNT

#define NEED_MOUNT ( )
Value:
do { ret = need_mount(); if(ret) \
{\
fprintf(stderr, "Error: Could not mount disk (%d).\n", ret); \
goto exit; \
} } while(0)
int need_mount(void)
Definition: fatten.c:110
#define stderr
Definition: stdio.h:100
#define exit(n)
Definition: config.h:202
int ret

Definition at line 125 of file fatten.c.

◆ NEED_PARAMS

#define NEED_PARAMS (   _min_,
  _max_ 
)
Value:
do {\
if (nargs < _min_) { fprintf(stderr, "Error: Too few args for command %s.\n" , argv[-1]); PRINT_HELP_AND_QUIT(); } \
if (nargs > _max_) { fprintf(stderr, "Error: Too many args for command %s.\n", argv[-1]); PRINT_HELP_AND_QUIT(); } \
} while(0)
#define PRINT_HELP_AND_QUIT()
Definition: fatten.c:88
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define argv
Definition: mplay32.c:18

Definition at line 104 of file fatten.c.

◆ PRINT_HELP_AND_QUIT

#define PRINT_HELP_AND_QUIT ( )
Value:
do { \
ret = 1; \
print_help(oargv[0]); \
goto exit; \
} while (0)

Definition at line 88 of file fatten.c.

Function Documentation

◆ get_fattime()

DWORD get_fattime ( void  )

Definition at line 20 of file fatten.c.

21{
22 /* 31-25: Year(0-127 org.1980), 24-21: Month(1-12), 20-16: Day(1-31) */
23 /* 15-11: Hour(0-23), 10-5: Minute(0-59), 4-0: Second(0-29 *2) */
24
25 time_t rawtime;
26 struct tm * timeinfo;
27
28 time(&rawtime);
29 timeinfo = localtime(&rawtime);
30
31 {
32 union FatTime {
33 struct {
34 DWORD Second : 5; // div 2
35 DWORD Minute : 6;
36 DWORD Hour : 5;
37 DWORD Day : 5;
38 DWORD Month : 4;
39 DWORD Year : 7; // year-1980
40 };
41 DWORD whole;
42 } myTime = {
43 {
44 timeinfo->tm_sec / 2,
45 timeinfo->tm_min,
46 timeinfo->tm_hour,
47 timeinfo->tm_mday,
48 timeinfo->tm_mon + 1,
49 timeinfo->tm_year - 80,
50 }
51 };
52
53 return myTime.whole;
54 }
55}
WCHAR Second[]
Definition: FormatMessage.c:12
__kernel_time_t time_t
Definition: linux.h:252
_In_ PLARGE_INTEGER _In_ BOOLEAN _Out_ PFAT_TIME_STAMP FatTime
Definition: fatprocs.h:1916
unsigned long DWORD
Definition: ntddk_ex.h:95
__u16 time
Definition: mkdosfs.c:8
_CRTIMP struct tm *__cdecl localtime(const time_t *_Time)
Definition: time.h:416
Definition: time.h:68
int tm_mon
Definition: time.h:73
int tm_year
Definition: time.h:74
int tm_hour
Definition: time.h:71
int tm_sec
Definition: time.h:69
int tm_mday
Definition: time.h:72
int tm_min
Definition: time.h:70

◆ is_command()

int is_command ( const char parg)

Definition at line 95 of file fatten.c.

96{
97#if _WIN32
98 return (parg[0] == '/') || (parg[0] == '-');
99#else
100 return (parg[0] == '-');
101#endif
102}

Referenced by main().

◆ main()

int main ( int  oargc,
char oargv[] 
)

Definition at line 132 of file fatten.c.

133{
134 int ret;
135 int argc = oargc - 1;
136 char** argv = oargv + 1;
137
138 // first parameter must be the image file.
139 if (argc == 0)
140 {
141 fprintf(stderr, "Error: First parameter must be a filename.\n");
143 }
144
145 if (is_command(argv[0]))
146 {
147 fprintf(stderr, "Error: First parameter must be a filename, found '%s' instead.\n", argv[0]);
149 }
150
151 if (disk_openimage(0, argv[0]))
152 {
153 fprintf(stderr, "Error: Could not open image file '%s'.\n", argv[0]);
154 ret = 1;
155 goto exit;
156 }
157
158 argc--;
159 argv++;
160
161 while (argc > 0)
162 {
163 char* parg = *argv;
164 int nargs = 0;
165 int i = 0;
166
167 if (!is_command(parg))
168 {
169 fprintf(stderr, "Error: Expected a command, found '%s' instead.\n", parg);
171 }
172
173 parg++;
174 argv++;
175 argc--;
176
177 // find next command, to calculare number of args
178 while ((argv[i] != NULL) && !is_command(argv[i++]))
179 nargs++;
180
181 if (strcmp(parg, "format") == 0)
182 {
183 // NOTE: The fs driver detects which FAT format fits best based on size
184 int sectors;
185
186 NEED_PARAMS(1, 2);
187
188 // Arg 1: number of sectors
189 sectors = atoi(argv[0]);
190
191 if (sectors <= 0)
192 {
193 fprintf(stderr, "Error: Sectors must be > 0\n");
194 ret = 1;
195 goto exit;
196 }
197
199 {
200 fprintf(stderr, "Error: Failed to set sector count to %d.\n", sectors);
201 ret = 1;
202 goto exit;
203 }
204
205 NEED_MOUNT();
206
207 ret = f_mkfs("0:", 1, sectors < 4096 ? 1 : 8);
208 if (ret)
209 {
210 fprintf(stderr, "Error: Formatting drive: %d.\n", ret);
211 goto exit;
212 }
213
214 // Arg 2: custom header label (optional)
215 if (nargs > 1)
216 {
217#define FAT_VOL_LABEL_LEN 11
218 char vol_label[2 + FAT_VOL_LABEL_LEN + 1]; // Null-terminated buffer
219 char* label = vol_label + 2; // The first two characters are reserved for the drive number "0:"
220 char ch;
221
222 int i, invalid = 0;
223 int len = strlen(argv[1]);
224
225 if (len <= FAT_VOL_LABEL_LEN)
226 {
227 // Verify each character (should be printable ASCII)
228 // and copy it in uppercase.
229 for (i = 0; i < len; i++)
230 {
231 ch = toupper(argv[1][i]);
232 if ((ch < 0x20) || !isprint(ch))
233 {
234 invalid = 1;
235 break;
236 }
237
238 label[i] = ch;
239 }
240
241 if (!invalid)
242 {
243 // Pad the label with spaces
244 while (len < FAT_VOL_LABEL_LEN)
245 {
246 label[len++] = ' ';
247 }
248 }
249 }
250 else
251 {
252 invalid = 1;
253 }
254
255 if (invalid)
256 {
257 fprintf(stderr, "Error: Header label is limited to 11 printable uppercase ASCII symbols.");
258 ret = 1;
259 goto exit;
260 }
261
262 if (disk_read(0, buff, 0, 1))
263 {
264 fprintf(stderr, "Error: Unable to read existing boot sector from image.");
265 ret = 1;
266 goto exit;
267 }
268
270 {
272 }
273 else
274 {
276 }
277
278 if (disk_write(0, buff, 0, 1))
279 {
280 fprintf(stderr, "Error: Unable to write new boot sector to image.");
281 ret = 1;
282 goto exit;
283 }
284
285 // Set also the directory volume label
286 memcpy(vol_label, "0:", 2);
287 vol_label[2 + FAT_VOL_LABEL_LEN] = '\0';
288 if (f_setlabel(vol_label))
289 {
290 fprintf(stderr, "Error: Unable to set the volume label.");
291 ret = 1;
292 goto exit;
293 }
294 }
295 }
296 else if (strcmp(parg, "boot") == 0)
297 {
298 FILE* fe;
299 BYTE* temp = buff + 1024;
300
301 NEED_PARAMS(1, 1);
302
303 // Arg 1: boot file
304
305 fe = fopen(argv[0], "rb");
306 if (!fe)
307 {
308 fprintf(stderr, "Error: Unable to open external file '%s' for reading.", argv[0]);
309 ret = 1;
310 goto exit;
311 }
312
313 if (!fread(buff, 512, 1, fe))
314 {
315 fprintf(stderr, "Error: Unable to read boot sector from file '%s'.", argv[0]);
316 fclose(fe);
317 ret = 1;
318 goto exit;
319 }
320
321 fclose(fe);
322
323 NEED_MOUNT();
324
325 if (disk_read(0, temp, 0, 1))
326 {
327 fprintf(stderr, "Error: Unable to read existing boot sector from image.");
328 ret = 1;
329 goto exit;
330 }
331
333 {
334 printf("TODO: Writing boot sectors for FAT32 images not yet supported.");
335 ret = 1;
336 goto exit;
337 }
338 else
339 {
340#define FAT16_HEADER_START 3
341#define FAT16_HEADER_END 62
342
344 }
345
346 if (disk_write(0, buff, 0, 1))
347 {
348 fprintf(stderr, "Error: Unable to write new boot sector to image.");
349 ret = 1;
350 goto exit;
351 }
352 }
353 else if (strcmp(parg, "add") == 0)
354 {
355 FILE* fe;
356 FIL fv = { 0 };
357 UINT rdlen = 0;
358 UINT wrlen = 0;
359
360 NEED_PARAMS(2, 2);
361
362 NEED_MOUNT();
363
364 // Arg 1: external file to add
365 // Arg 2: virtual filename
366
367 fe = fopen(argv[0], "rb");
368 if (!fe)
369 {
370 fprintf(stderr, "Error: Unable to open external file '%s' for reading.", argv[0]);
371 ret = 1;
372 goto exit;
373 }
374
375 if (f_open(&fv, argv[1], FA_WRITE | FA_CREATE_ALWAYS))
376 {
377 fprintf(stderr, "Error: Unable to open file '%s' for writing.", argv[1]);
378 fclose(fe);
379 ret = 1;
380 goto exit;
381 }
382
383 while ((rdlen = fread(buff, 1, sizeof(buff), fe)) > 0)
384 {
385 if (f_write(&fv, buff, rdlen, &wrlen) || wrlen < rdlen)
386 {
387 fprintf(stderr, "Error: Unable to write '%d' bytes to disk.", wrlen);
388 ret = 1;
389 goto exit;
390 }
391 }
392
393 fclose(fe);
394 f_close(&fv);
395 }
396 else if (strcmp(parg, "extract") == 0)
397 {
398 FIL fe = { 0 };
399 FILE* fv;
400 UINT rdlen = 0;
401 UINT wrlen = 0;
402
403 NEED_PARAMS(2, 2);
404
405 NEED_MOUNT();
406
407 // Arg 1: virtual file to extract
408 // Arg 2: external filename
409
410 if (f_open(&fe, argv[0], FA_READ))
411 {
412 fprintf(stderr, "Error: Unable to open file '%s' for reading.", argv[0]);
413 ret = 1;
414 goto exit;
415 }
416
417 fv = fopen(argv[1], "wb");
418 if (!fv)
419 {
420 fprintf(stderr, "Error: Unable to open external file '%s' for writing.", argv[1]);
421 f_close(&fe);
422 ret = 1;
423 goto exit;
424 }
425
426 while ((f_read(&fe, buff, sizeof(buff), &rdlen) == 0) && (rdlen > 0))
427 {
428 if (fwrite(buff, 1, rdlen, fv) < rdlen)
429 {
430 fprintf(stderr, "Error: Unable to write '%d' bytes to file.", rdlen);
431 ret = 1;
432 goto exit;
433 }
434 }
435
436 f_close(&fe);
437 fclose(fv);
438 }
439 else if (strcmp(parg, "move") == 0)
440 {
441 NEED_PARAMS(2, 2);
442
443 NEED_MOUNT();
444 // Arg 1: src path & filename
445 // Arg 2: new path & filename
446
447 if (f_rename(argv[0], argv[1]))
448 {
449 fprintf(stderr, "Error: Unable to move/rename '%s' to '%s'", argv[0], argv[1]);
450 ret = 1;
451 goto exit;
452 }
453 }
454 else if (strcmp(parg, "copy") == 0)
455 {
456 FIL fe = { 0 };
457 FIL fv = { 0 };
458 UINT rdlen = 0;
459 UINT wrlen = 0;
460
461 NEED_PARAMS(2, 2);
462
463 NEED_MOUNT();
464 // Arg 1: src path & filename
465 // Arg 2: new path & filename
466
467 if (f_open(&fe, argv[0], FA_READ))
468 {
469 fprintf(stderr, "Error: Unable to open file '%s' for reading.", argv[0]);
470 ret = 1;
471 goto exit;
472 }
473 if (f_open(&fv, argv[1], FA_WRITE | FA_CREATE_ALWAYS))
474 {
475 fprintf(stderr, "Error: Unable to open file '%s' for writing.", argv[1]);
476 f_close(&fe);
477 ret = 1;
478 goto exit;
479 }
480
481 while ((f_read(&fe, buff, sizeof(buff), &rdlen) == 0) && (rdlen > 0))
482 {
483 if (f_write(&fv, buff, rdlen, &wrlen) || wrlen < rdlen)
484 {
485 fprintf(stderr, "Error: Unable to write '%d' bytes to disk.", wrlen);
486 ret = 1;
487 goto exit;
488 }
489 }
490
491 f_close(&fe);
492 f_close(&fv);
493 }
494 else if (strcmp(parg, "mkdir") == 0)
495 {
496 NEED_PARAMS(1, 1);
497
498 NEED_MOUNT();
499
500 // Arg 1: folder path
501 if (f_mkdir(argv[0]))
502 {
503 fprintf(stderr, "Error: Unable to create directory.");
504 ret = 1;
505 goto exit;
506 }
507 }
508 else if (strcmp(parg, "delete") == 0)
509 {
510 NEED_PARAMS(1, 1);
511
512 NEED_MOUNT();
513
514 // Arg 1: file/folder path (cannot delete non-empty folders)
515 if (f_unlink(argv[0]))
516 {
517 fprintf(stderr, "Error: Unable to delete file or directory.");
518 ret = 1;
519 goto exit;
520 }
521 }
522 else if (strcmp(parg, "list") == 0)
523 {
524 char* root = "/";
525 DIR dir = { 0 };
526 FILINFO info = { 0 };
527 char lfname[257];
528
529 NEED_PARAMS(0, 1);
530
531 // Arg 1: folder path (optional)
532
533 if (nargs == 1)
534 {
535 root = argv[0];
536 }
537
538 if (f_opendir(&dir, root))
539 {
540 fprintf(stderr, "Error: Unable to opening directory '%s' for listing.\n", root);
541 ret = 1;
542 goto exit;
543 }
544
545 printf("Listing directory contents of: %s\n", root);
546
547 info.lfname = lfname;
548 info.lfsize = sizeof(lfname)-1;
549 while ((!f_readdir(&dir, &info)) && (strlen(info.fname) > 0))
550 {
551 if (strlen(info.lfname) > 0)
552 printf(" - %s (%s)\n", info.lfname, info.fname);
553 else
554 printf(" - %s\n", info.fname);
555 }
556 }
557 else
558 {
559 fprintf(stderr, "Error: Unknown or invalid command: %s\n", argv[-1]);
561 }
562 argv += nargs;
563 argc -= nargs;
564 }
565
566 ret = 0;
567
568exit:
569
570 disk_cleanup(0);
571
572 return ret;
573}
static int argc
Definition: ServiceArgs.c:12
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define isprint(c)
Definition: acclib.h:73
int toupper(int c)
Definition: utclib.c:881
unsigned int dir
Definition: maze.c:112
static BOOLEAN disk_read(ULONG DeviceId, u64 physical, void *dest, u32 count)
Definition: btrfs.c:253
VOID disk_cleanup(BYTE pdrv)
Definition: diskio.c:48
DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void *buff)
Definition: diskio.c:169
DSTATUS disk_openimage(BYTE pdrv, const char *imageFileName)
Definition: diskio.c:24
#define SET_SECTOR_COUNT
Definition: diskio.h:61
#define NULL
Definition: types.h:112
#define FAT16_HEADER_START
int is_command(const char *parg)
Definition: fatten.c:95
static FATFS g_Filesystem
Definition: fatten.c:15
#define FAT16_HEADER_END
#define NEED_MOUNT()
Definition: fatten.c:125
#define NEED_PARAMS(_min_, _max_)
Definition: fatten.c:104
static unsigned char buff[32768]
Definition: fatten.c:17
#define FAT_VOL_LABEL_LEN
FRESULT f_unlink(const TCHAR *path)
Definition: ff.c:3526
FRESULT f_mkdir(const TCHAR *path)
Definition: ff.c:3595
FRESULT f_close(FIL *fp)
Definition: ff.c:2857
FRESULT f_mkfs(const TCHAR *path, BYTE sfd, UINT au)
Definition: ff.c:4068
FRESULT f_rename(const TCHAR *path_old, const TCHAR *path_new)
Definition: ff.c:3713
FRESULT f_setlabel(const TCHAR *label)
Definition: ff.c:3906
FRESULT f_readdir(DIR *dp, FILINFO *fno)
Definition: ff.c:3275
FRESULT f_opendir(DIR *dp, const TCHAR *path)
Definition: ff.c:3187
FRESULT f_read(FIL *fp, void *buff, UINT btr, UINT *br)
Definition: ff.c:2586
FRESULT f_write(FIL *fp, const void *buff, UINT btw, UINT *bw)
Definition: ff.c:2687
FRESULT f_open(FIL *fp, const TCHAR *path, BYTE mode)
Definition: ff.c:2449
#define FA_READ
Definition: ff.h:294
#define FS_FAT32
Definition: ff.h:311
#define FA_WRITE
Definition: ff.h:298
#define FA_CREATE_ALWAYS
Definition: ff.h:300
#define printf
Definition: freeldr.h:93
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP size_t __cdecl fwrite(_In_reads_bytes_(_Size *_Count) const void *_Str, _In_ size_t _Size, _In_ size_t _Count, _Inout_ FILE *_File)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
__u8 sectors[2]
Definition: mkdosfs.c:8
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static NTSTATUS disk_write(RDPCLIENT *This, NTHANDLE handle, uint8 *data, uint32 length, uint32 offset, uint32 *result)
Definition: disk.c:585
static const WCHAR label[]
Definition: itemdlg.c:1546
static const WCHAR invalid[]
Definition: assoc.c:39
unsigned int UINT
Definition: ndis.h:50
static calc_node_t temp
Definition: rpn_ieee.c:38
Definition: dirent.h:40
BYTE fs_type
Definition: ff.h:79
Definition: ff.h:168
Definition: ff.h:114
unsigned char BYTE
Definition: xxhash.c:193

◆ need_mount()

int need_mount ( void  )

Definition at line 110 of file fatten.c.

111{
112 int r;
113
114 if (isMounted)
115 return FR_OK;
116
117 r = f_mount(&g_Filesystem, "0:", 0);
118 if (r)
119 return r;
120
121 isMounted = 1;
122 return FR_OK;
123}
static int isMounted
Definition: fatten.c:16
FRESULT f_mount(FATFS *fs, const TCHAR *path, BYTE opt)
Definition: ff.c:2402
@ FR_OK
Definition: ff.h:185
GLdouble GLdouble GLdouble r
Definition: gl.h:2055

◆ print_help()

void print_help ( const char name)

Definition at line 57 of file fatten.c.

58{
59 printf("\n");
60 printf("Syntax: %s image_file [list of commands]\n\n", name);
61#if _WIN32
62 printf("Commands: [Note: both '/' and '-' are accepted as command prefixes.]\n");
63#else
64 printf("Commands:\n");
65#endif
66 // printf(" -format <sectors> [<filesystem>] [<custom header label>]\n"
67 printf(" -format <sectors> [<custom header label>]\n"
68 " Formats the disk image.\n");
69 printf(" -boot <sector file>\n"
70 " Writes a new boot sector.\n");
71 printf(" -add <src path> <dst path>\n"
72 " Copies an external file or directory into the image.\n");
73 printf(" -extract <src path> <dst path>\n"
74 " Copies a file or directory from the image into an external file\n"
75 " or directory.\n");
76 printf(" -move <src path> <new path>\n"
77 " Moves/renames a file or directory.\n");
78 printf(" -copy <src path> <new path>\n"
79 " Copies a file or directory.\n");
80 printf(" -mkdir <src path> <new path>\n"
81 " Creates a directory.\n");
82 printf(" -rmdir <src path> <new path>\n"
83 " Creates a directory.\n");
84 printf(" -list [<pattern>]\n"
85 " Lists files a directory (defaults to root).\n");
86}
Definition: name.c:39

Variable Documentation

◆ buff

unsigned char buff[32768]
static

Definition at line 17 of file fatten.c.

Referenced by _BSTR_CY(), _BSTR_DATE(), _BSTR_DEC(), _gcvt(), _gcvt_s(), _ILCreateFromFindDataW(), ata_check_unit(), check_class(), check_reg_entries(), compare_info(), convert_str(), DIALOG_StatusBarUpdateCaretPos(), disk_ioctl(), disk_read(), disk_write(), DoTypeFile(), DP_LoadSP(), dumpMenu(), f_read(), f_write(), find_best_locale_proc(), get_assembly_version(), get_temp_buffer(), get_vtbl_entry_name(), GetBuff(), GetContentsOfDialog(), GetContentsOfMenu(), GetExportFunctionNames(), GetImportFunctionNamesByModule(), GetListOfResourceTypes(), getSection(), gxv_kern_subtable_fmt1_subtable_setup(), gxv_mort_subtable_type1_subtable_setup(), gxv_mort_subtable_type2_subtable_setup(), gxv_morx_subtable_type1_subtable_setup(), gxv_morx_subtable_type2_subtable_setup(), gxv_morx_subtable_type5_subtable_setup(), gxv_set_length_by_ulong_offset(), gxv_set_length_by_ushort_offset(), gxv_StateTable_subtable_setup(), gxv_XStateTable_subtable_setup(), IDirectMusic8Impl_GetDefaultPort(), IDirectPlay4AImpl_EnumConnections(), IDirectPlayLobby3AImpl_EnumAddressTypes(), IDirectPlayLobby3AImpl_EnumLocalApplications(), IStreamIteratorTest::istmit1(), main(), MONTHCAL_UpdateSize(), mxwriter_get_output(), myGetToken(), NLS_GetDateTimeFormatW(), openSection(), PathCompactPathW(), PathFindOnPathExA(), PathFindOnPathExW(), PathMakeSystemFolderW(), pfr_lookup_bitmap_data(), PrintMenu(), query_file_path(), Read(), read_header_file(), readSection(), SHAboutInfoA(), SHAboutInfoW(), SHCopyKeyW(), SHLWAPI_PathFindInOtherDirs(), SlistTest::slist1(), SQLGetPrivateProfileString(), SQLGetPrivateProfileStringW(), test__wfopen_s(), test_actctx_classes(), test_aw_conversion_dlgproc(), test_aw_conversion_dlgproc2(), test_bufferrawformat(), test_canceleditlabel(), test_CbOfEncoded(), test_CList(), test_columns(), test_comboex_CB_GETLBTEXT(), test_cp932(), test_create(), test_createProcessingInstruction(), test_dispinfo(), test_domdoc(), test_drawimage(), test_EM_GETLINE(), test_find_window_class(), test_fopen_s(), test_FromGdiDib(), test_gdi_objects(), test_GdipCreateBitmapFromHBITMAP(), test_GdipDrawImagePointsRect(), test_getElementsByTagName(), test_getroletext(), test_keynames(), test_mxwriter_flush(), test_norecompute(), test_OpenFile(), test_PathMakePretty(), test_PathUnExpandEnvStrings(), test_put_data(), test_Scan0(), test_SHCreateMemStream(), test_SHFormatDateTimeA(), test_SHFormatDateTimeW(), test_SHLWAPI_184(), test_SHLWAPI_212(), test_sorting(), test_state_image(), test_StreamOnIStream(), test_StrRetToStringNW(), test_TVM_SORTCHILDREN(), test_VarAbs(), test_VarBoolFromStr(), test_VarDateFromStr(), test_VarDecFromStr(), test_VarFormat(), test_VarFormatFromTokens(), test_VarFormatNumber(), test_VarI1FromStr(), test_VarI2FromStr(), test_VarI4FromStr(), test_VarI8FromStr(), test_VarR4FromStr(), test_VarR8FromStr(), test_VarRound(), test_VarUI1FromStr(), test_VarUI2FromStr(), test_VarUI4FromStr(), test_VarUI8FromStr(), test_VarWeekdayName(), test_wm_set_get_text(), textstream_read(), trace_cache(), TranslateFunctionName(), UDFCanNameBeA8dot3(), UDFCheckArea(), UDFCompleteMount(), UDFDecompressUnicode(), UDFIndexDirectory(), UDFReadDiscTrackInfo(), UpdateStatusBar(), VarBstrFromCy(), VarBstrFromDec(), VarDateFromStr(), VarFormat(), VarFormatCurrency(), VarFormatNumber(), VarFormatPercent(), VARIANT_BstrFromReal(), VARIANT_BstrReplaceDecimal(), VARIANT_FormatDate(), VARIANT_FormatNumber(), VARIANT_FormatString(), VARIANT_GetLocalisedNumberChars(), WINHELP_RtfStreamIn(), write(), write_output_buffer(), and wtoascii().

◆ g_Filesystem

FATFS g_Filesystem
static

Definition at line 15 of file fatten.c.

Referenced by main(), and need_mount().

◆ isMounted

int isMounted = 0
static

Definition at line 16 of file fatten.c.

Referenced by need_mount(), and PiIrpSendRemoveCheckVpb().