FileX with file unicode 16 bit characters
I need to create, read and modify files using filex. Such files have names that uses cyrillic characters set (they must be codified using unicode 16 bit). It is possible to manage such files?
Thanks
I need to create, read and modify files using filex. Such files have names that uses cyrillic characters set (they must be codified using unicode 16 bit). It is possible to manage such files?
Thanks
hello
Yes, FileX supports file names containing Cyrillic characters through its 16-bit Unicode APIs.
In practice, the file must first be created or renamed using the Unicode services, such as fx_unicode_file_create(...) or fx_unicode_file_rename(...). Once this is done, the generated short name can be used with the standard FileX APIs such as fx_file_open(...), fx_file_read(...), and fx_file_write(...).
Example:
UCHAR unicode_name[] = {
0x14, 0x04, /* Д */
0x30, 0x04, /* а */
0x3D, 0x04, /* н */
0x3D, 0x04, /* н */
0x4B, 0x04, /* ы */
0x35, 0x04, /* е */
0x2E, 0x00, /* . */
0x74, 0x00, /* t */
0x78, 0x00, /* x */
0x74, 0x00, /* t */
0x00, 0x00
};
CHAR short_name[13];
FX_FILE file;
ULONG length;
ULONG bytes_read;
CHAR buffer[20];
UINT status;
length = fx_unicode_length_get(unicode_name);
status = fx_unicode_file_create(&media, unicode_name, length, short_name);
status = fx_file_open(&media, &file, short_name, FX_OPEN_FOR_WRITE);
status = fx_file_write(&file, "Bonjour", sizeof(“Bonjour”));
status = fx_file_close(&file);
status = fx_file_open(&media, &file, short_name, FX_OPEN_FOR_READ);
status = fx_file_read(&file, buffer, sizeof(“Bonjour”), &bytes_read);
status = fx_file_close(&file);
Regards,
Maher
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.