You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This service allocates and links one or more contiguous clusters to the end of the specified file. FileX determines the number of clusters required by dividing the requested size by the number of bytes per cluster. The result is then rounded up to the next whole cluster.
2459
2458
2460
-
This service is designed for exFAT. The *size* parameter takes a 64-bit integer value, which allows the caller to pre-allocate space beyond 4GB range.
2459
+
The *size* parameter takes a 64-bit integer value, which allows the caller to pre-allocate space beyond 4GB range.
This service allocates and links one or more contiguous clusters to the end of the specified file. FileX determines the number of clusters required by dividing the requested size by the number of bytes per cluster. The result is then rounded up to the next whole cluster. If there are not enough consecutive clusters available in the media, this service links the largest available block of consecutive clusters to the file. The amount of space actually allocated to the file is returned to the caller.
2546
2545
2547
-
This service is designed for exFAT. The *size* parameter takes a 64-bit integer value, which allows the caller to pre-allocate space beyond 4GB range.
2546
+
The *size* parameter takes a 64-bit integer value, which allows the caller to pre-allocate space beyond 4GB range.
This service positions the internal file read/write pointer to the specified relative byte offset. Any subsequent file read or write request will begin at this location in the file.
2635
2634
2636
-
This service is designed for exFAT. The *byte_offset* parameter takes a 64bit integer value, which allows the caller to reposition the read/write pointer beyond 4GB range.
2635
+
The *byte_offset* parameter takes a 64bit integer value, which allows the caller to reposition the read/write pointer beyond 4GB range.
2637
2636
2638
2637
If **FX_SEEK_BEGIN** is specified for the *seek_from parameter*, the seek operation is performed from the beginning of the file. If **FX_SEEK_END** is specified the seek operation is performed backward from the end of the file. If **FX_SEEK_FORWARD** is specified, the seek operation is performed forward from the current file position. If **FX_SEEK_BACK** is specified, the seek operation is performed backward from the current file position.
2639
2638
@@ -2725,7 +2724,7 @@ UINT fx_file_extended_seek(
2725
2724
2726
2725
This service positions the internal file read/write pointer to the specified byte offset. Any subsequent file read or write request will begin at this location in the file.
2727
2726
2728
-
This service is designed for exFAT. The *byte_offset* parameter takes a 64bit integer value, which allows the caller to reposition the read/write pointer beyond 4GB range.
2727
+
The *byte_offset* parameter takes a 64bit integer value, which allows the caller to reposition the read/write pointer beyond 4GB range.
2729
2728
2730
2729
### Input Parameters
2731
2730
@@ -2806,7 +2805,7 @@ This service truncates the size of the file to the specified size. If the suppli
2806
2805
2807
2806
> **Warning:** *Use caution truncating files that may also be simultaneously open for reading. Truncating a file also opened for reading can result in reading invalid data.*
2808
2807
2809
-
This service is designed for exFAT. The *size* parameter takes a 64-bit integer value, which allows the caller to operate beyond 4GB range.
2808
+
The *size* parameter takes a 64-bit integer value, which allows the caller to operate beyond 4GB range.
2810
2809
2811
2810
### Input Parameters
2812
2811
@@ -2890,7 +2889,7 @@ This service truncates the size of the file to the specified size. If the suppli
2890
2889
2891
2890
> **Warning:** *Use caution truncating files that may also be simultaneously open for reading. Truncating a file also opened for reading can result in reading invalid data.*
2892
2891
2893
-
This service is designed for exFAT. The *size* parameter takes a 64-bit integer value, which allows the caller to operate beyond 4GB range.
2892
+
The *size* parameter takes a 64-bit integer value, which allows the caller to operate beyond 4GB range.
2894
2893
2895
2894
### Input Parameters
2896
2895
@@ -3777,7 +3776,6 @@ status = fx_media_abort(&my_media);
3777
3776
- fx_media_check
3778
3777
- fx_media_close
3779
3778
- fx_media_close_notify_set
3780
-
- fx_media_exFAT_format
3781
3779
- fx_media_extended_space_available
3782
3780
- fx_media_flush
3783
3781
- fx_media_format
@@ -3840,7 +3838,6 @@ status = fx_media_cache_invalidate(&my_media);
3840
3838
- fx_media_check
3841
3839
- fx_media_close
3842
3840
- fx_media_close_notify_set
3843
-
- fx_media_exFAT_format
3844
3841
- fx_media_extended_space_available
3845
3842
- fx_media_flush
3846
3843
- fx_media_format
@@ -3937,7 +3934,6 @@ status = fx_media_check(&my_media, sratch_memory, 4096,
3937
3934
- fx_media_cache_invalidate
3938
3935
- fx_media_close
3939
3936
- fx_media_close_notify_set
3940
-
- fx_media_exFAT_format
3941
3937
- fx_media_extended_space_available
3942
3938
- fx_media_flush
3943
3939
- fx_media_format
@@ -4000,7 +3996,6 @@ status = fx_media_close(&my_media);
Formats the specified media as an exFAT file system.
4077
-
4078
-
### Prototype
4079
-
4080
-
```c
4081
-
UINT fx_media_exFAT_format(
4082
-
FX_MEDIA *media_ptr,
4083
-
VOID (*driver)(FX_MEDIA *media),
4084
-
VOID *driver_info_ptr,
4085
-
UCHAR *memory_ptr,
4086
-
UINT memory_size,
4087
-
CHAR *volume_name,
4088
-
UINT number_of_fats,
4089
-
ULONG64 hidden_sectors,
4090
-
ULONG64 total_sectors,
4091
-
UINT bytes_per_sector,
4092
-
UINT sectors_per_cluster,
4093
-
UINT volume_serial_number,
4094
-
UINT boundary_unit);
4095
-
```
4096
-
4097
-
### Description
4098
-
4099
-
This service formats the supplied media in an exFAT compatible manner based on the supplied parameters. This service must be called prior to opening the media.
4100
-
4101
-
> **Warning:** *Formatting an already formatted media effectively erases all files and directories on the media.*
4102
-
4103
-
> **Important:** *The exFAT volume size should match the size of the partition (if there is an MBR or GPT layout), or the size of the whole device if there is no partition layout (no MBR or GPT). There is a limitation on Windows that exFAT Disk will not be recognized if formatted with some values of total sectors that are less than available sectors*
4104
-
4105
-
> **Important:** *With reference to the specification, the bytes per sector may take on only the following values: 512, 1024, 2048 or 4096.*
4106
-
4107
-
### Input Parameters
4108
-
4109
-
- *media_ptr*: Pointer to the media control block. This is used only to provide some basic information necessary for the driver to operate.
4110
-
- *driver*: Pointer to the I/O driver for this media. This will typically be the same driver supplied to the subsequent fx_media_open call.
4111
-
- *driver_info_ptr*: Pointer to the optional information that the I/O driver may utilize.
4112
-
- *memory_ptr*: Pointer to the working memory for the media. memory_size Specifies the size of the working media memory. The size must be at least as large as the media's sector size.
4113
-
- *volume_name*: Pointer to the volume name string, which is a maximum of 11 characters.
4114
-
- *number_of_fats*: Number of FATs on the media. Current implementation supports one FAT on the media.
4115
-
- *hidden_sectors*: Number of sectors hidden before this media's boot sector. This is typical when multiple partitions are present.
4116
-
- *total_sectors*: Total number of sectors in the media.
4117
-
- *bytes_per_sector*: Number of bytes per sector, which is typically 512. FileX requires this to be a multiple of 32.
4118
-
- *sectors_per_cluster*: Number of sectors in each cluster. The cluster is the minimum allocation unit in a FAT file system.
4119
-
- *volume_serial_number*: Serial number to be used for this volume.
4120
-
- *boundary_unit*: Physical data area alignment size, in number of sectors.
4121
-
4122
-
### Return Values
4123
-
4124
-
- **FX_SUCCESS** (0x00) Successful media format.
4125
-
- **FX_IO_ERROR** (0x90) Driver I/O error.
4126
-
- **FX_PTR_ERROR** (0x18) Invalid media, driver, or memory pointer.
4127
-
- **FX_CALLER_ERROR** (0x20) Caller is not a thread.
4128
-
4129
-
### Allowed From
4130
-
4131
-
Threads
4132
-
4133
-
### Example
4134
-
4135
-
```c
4136
-
FX_MEDIA sd_card;
4137
-
UCHAR media_memory[512];
4138
-
4139
-
/* Format a 64GB SD card with exFAT file system. The media has
4140
-
been properly partitioned, with the partition starts from sector 32768.
4141
-
For 64GB, there are total of 120913920 sectors, each sector 512 bytes. */
4142
-
4143
-
status = fx_media_exFAT_format(&sd_card, _fx_sd_driver,
4144
-
driver_information, media_memory,
4145
-
sizeof(media_memory),
4146
-
"exFAT_DISK" /* Volume Name */,
4147
-
1 /* Number of FATs */,
4148
-
32768 /* Hidden sectors */,
4149
-
120913920 /* Total sectors */,
4150
-
512 /* Sector size */,
4151
-
256 /* Sectors per cluster */,
4152
-
12345 /* Volume ID */,
4153
-
8192 /* Boundary unit */);
4154
-
4155
-
/* If status is FX_SUCCESS, the media was successfully formatted. */
This service returns the number of bytes available in the media.
4194
4083
4195
-
This service is designed for exFAT. The pointer to *available_bytes* parameter takes a 64-bit integer value, which allows the caller to work with media beyond 4GB range.
4084
+
The pointer to *available_bytes* parameter takes a 64-bit integer value, which allows the caller to work with media beyond 4GB range.
4196
4085
4197
4086
### Input Parameters
4198
4087
@@ -4232,7 +4121,6 @@ status = fx_media_extended_space_available(&my_media, &available_bytes);
4232
4121
- fx_media_check
4233
4122
- fx_media_close
4234
4123
- fx_media_close_notify_set
4235
-
- fx_media_exFAT_format
4236
4124
- fx_media_flush
4237
4125
- fx_media_format
4238
4126
- fx_media_open
@@ -4301,7 +4189,6 @@ status = fx_media_flush(&my_media);
4301
4189
- fx_media_check
4302
4190
- fx_media_close
4303
4191
- fx_media_close_notify_set
4304
-
- fx_media_exFAT_format
4305
4192
- fx_media_extended_space_available
4306
4193
- fx_media_format
4307
4194
- fx_media_open
@@ -4421,7 +4308,6 @@ status = fx_media_format(&ram_disk, _fx_ram_driver,
@@ -4628,7 +4512,6 @@ status = fx_media_read(&my_media, 22, my_buffer);
4628
4512
- fx_media_check
4629
4513
- fx_media_close
4630
4514
- fx_media_close_notify_set
4631
-
- fx_media_exFAT_format
4632
4515
- fx_media_extended_space_available
4633
4516
- fx_media_flush
4634
4517
- fx_media_format
@@ -4696,7 +4579,6 @@ status = fx_media_space_available(&my_media, &available_bytes);
4696
4579
- fx_media_check
4697
4580
- fx_media_close
4698
4581
- fx_media_close_notify_set
4699
-
- fx_media_exFAT_format
4700
4582
- fx_media_extended_space_available
4701
4583
- fx_media_flush
4702
4584
- fx_media_format
@@ -4768,7 +4650,6 @@ status = fx_media_volume_get_extended(&ram_disk, volume_name,
4768
4650
- fx_media_check
4769
4651
- fx_media_close
4770
4652
- fx_media_close_notify_set
4771
-
- fx_media_exFAT_format
4772
4653
- fx_media_extended_space_available
4773
4654
- fx_media_flush
4774
4655
- fx_media_format
@@ -4845,7 +4726,6 @@ status = fx_media_volume_get_extended(&ram_disk, volume_name,
4845
4726
- fx_media_check
4846
4727
- fx_media_close
4847
4728
- fx_media_close_notify_set
4848
-
- fx_media_exFAT_format
4849
4729
- fx_media_extended_space_available
4850
4730
- fx_media_flush
4851
4731
- fx_media_format
@@ -4913,7 +4793,6 @@ status = fx_media_volume_set(&ram_disk, "MY_VOLUME");
4913
4793
- fx_media_check
4914
4794
- fx_media_close
4915
4795
- fx_media_close_notify_set
4916
-
- fx_media_exFAT_format
4917
4796
- fx_media_extended_space_available
4918
4797
- fx_media_flush
4919
4798
- fx_media_format
@@ -4986,7 +4865,6 @@ status = fx_media_write(&my_media, 22, my_buffer);
4986
4865
- fx_media_check
4987
4866
- fx_media_close
4988
4867
- fx_media_close_notify_set
4989
-
- fx_media_exFAT_format
4990
4868
- fx_media_extended_space_available
4991
4869
- fx_media_flush
4992
4870
- fx_media_format
@@ -5295,8 +5173,6 @@ This service creates a Unicode-named subdirectory in the current default directo
5295
5173
5296
5174
> **Warning:** *All operations on the Unicode subdirectory (making it the default path, deleting, etc.) should be done by supplying the returned short name (8.3 format) to the standard FileX directory services.*
5297
5175
5298
-
> **Important:** *This service is not supported on exFAT media.*
5299
-
5300
5176
### Input Parameters
5301
5177
5302
5178
- *media_ptr*: Pointer to media control block.
@@ -5310,7 +5186,6 @@ This service creates a Unicode-named subdirectory in the current default directo
5310
5186
- **FX_MEDIA_NOT_OPEN** (0x11) Specified media is not open.
This service changes a Unicode-named subdirectory to specified new Unicode name in current working directory. The Unicode name parameters must not have path information.
5384
5259
5385
-
> **Important:** *This service is not supported on exFAT media.*
5386
-
5387
5260
### Input Parameters
5388
5261
5389
5262
- *media_ptr*: Pointer to media control block.
@@ -5481,7 +5354,6 @@ This service creates a Unicode-named file in the current default directory—no
5481
5354
- **FX_MEDIA_NOT_OPEN** (0x11) Specified media is not open.
This service changes a Unicode-named file name to specified new Unicode name in current default directory. The Unicode name parameters must not have path information.
5561
5433
5562
-
> **Important:** *This service is not supported on exFAT media.*
5563
-
5564
5434
### Input Parameters
5565
5435
5566
5436
- *media_ptr*: Pointer to media control block.
@@ -5997,7 +5867,6 @@ This service retrieves the short name (8.3 format) associated with the Unicode-n
5997
5867
- **FX_IO_ERROR** (0x90) Driver I/O error.
5998
5868
- **FX_MEDIA_NOT_OPEN** (0x11) Specified media is not open.
5999
5869
- **FX_NOT_FOUND** (0x04) Unicode name was not found.
6000
-
- **FX_NOT_IMPLEMENTED** (0x22) Service not implemented for exFAT file system.
6001
5870
- **FX_SECTOR_INVALID** (0x89) Invalid sector.
6002
5871
- **FX_PTR_ERROR** (0x18) Invalid media or name pointers.
6003
5872
- **FX_CALLER_ERROR** (0x20) Caller is not a thread.
@@ -6092,7 +5961,6 @@ This service retrieves the short name (8.3 format) associated with the Unicode-n
6092
5961
- **FX_IO_ERROR** (0x90) Driver I/O error.
6093
5962
- **FX_MEDIA_NOT_OPEN** (0x11) Specified media is not open.
6094
5963
- **FX_NOT_FOUND** (0x04) Unicode name was not found.
6095
-
- **FX_NOT_IMPLEMENTED** (0x22) Service not implemented for exFAT file system.
6096
5964
- **FX_SECTOR_INVALID** (0x89) Invalid sector.
6097
5965
- **FX_PTR_ERROR** (0x18) Invalid media or name pointers.
6098
5966
- **FX_CALLER_ERROR** (0x20) Caller is not a thread.
0 commit comments