User manual
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
287
Cf_Fat_Assign
Prototype
sub function Cf_Fat_Assign(dim byref lename as char[12], dim le_cre_attr
as byte) as word
Description Assigns le for le operations (read, write, delete...). All subsequent le operations will be applied over
the assigned le.
Parameters - lename: name of the le that should be assigned for le operations. The le name should be in
DOS 8.3 (le_name.extension) format. The le name and extension will be automatically padded with
spaces by the library if they have less than length required (i.e. “mikro.tx” -> “mikro .tx “), so the user
does not have to take care of that. The le name and extension are case insensitive. The library will
convert them to proper case automatically, so the user does not have to take care of that.
Also, in order to keep backward compatibility with the rst version of this library, le names can be
entered as UPPERCASE string of 11 bytes in length with no dot character between the le name and
extension (i.e. “MIKROELETXT” -> MIKROELE.TXT). In this case the last 3 characters of the string
are considered to be le extension.
- le_cre_attr: le creation and attributes ags. Each bit corresponds to the appropriate le
attribute:
Returns - 0 if le does not exist and no new le is created.
- 1 if le already exists or le does not exist but a new le is created.
Requires CF card and CF library must be initialized for le operations. See Cf_Fat_Init.
Example
‘ create le with archive attribut if it does not already exist
Cf_Fat_Assign(“MIKRO007.TXT”,0xA0)
Notes Long File Names (LFN) are not supported.
Bit Mask Description
0 0x01 Read Only
1 0x02 Hidden
2 0x04 System
3 0x08 Volume Label
4 0x10 Subdirectory
5 0x20 Archive
6 0x40 Device (internal use only, never found on disk)
7 0x80
File creation ag. If the le does not exist and this ag is
set, a new le with specied name will be created.