File_ListPartitions()

Parent Previous Next

Syntax

File_ListPartitions(), Byte


Return value — number of partitions found (primary + logical, up to 8)

       

Returns the number of partitions in SD card


Scans the MBR for FAT16/32 partitions (up to 4 primary slots), and if one of those primary slots is an Extended Partition container, also

walks its chain of logical drives (EBRs) - capped at 8 total partitions (primary + logical combined). 


If sector 0 is itself a boot sector (no partition table), that counts as a single partition.


Requires the card to already be initialized (a prior File_Init() call).



Example

    File_Init()

    bTemp = File_ListPartitions()

    TftPrintSndString(Str$(Dec bTemp), 1, 0,0,1, RED,BLACK,0)

    sTemp = File_PartitionName(1)

    TftPrintSndString(sTemp, 1, 0,1,1, RED,BLACK,0)

    sTemp = File_PartitionName(2)

    TftPrintSndString(sTemp, 1, 0,2,1, RED,BLACK,0)

    sTemp = File_PartitionName(3)

    TftPrintSndString(sTemp, 1, 0,3,1, RED,BLACK,0)

    sTemp = File_PartitionName(4)

    TftPrintSndString(sTemp, 1, 0,4,1, RED,BLACK,0)

    sTemp = File_PartitionName(5)

    TftPrintSndString(sTemp, 1, 0,5,1, RED,BLACK,0)

    sTemp = File_PartitionName(6)

    TftPrintSndString(sTemp, 1, 0,6,1, RED,BLACK,0)

    DelayMS 3000


    File_SetPartition(1)

    TftBmpFromSd("bird.bmp",0,0)

    DelayMS 2000

    File_SetPartition(2)

    TftBmpFromSd("cat.bmp",0,0)

    DelayMS 2000

    File_SetPartition(3)

    TftBmpFromSd("dog.bmp",0,0)

    DelayMS 2000

    File_SetPartition(4)

    TftBmpFromSd("bunny.bmp",0,0)

    DelayMS 2000

    File_SetPartition(5)

    TftBmpFromSd("frog.bmp",0,0)

    DelayMS 2000

    File_SetPartition(6)

    TftBmpFromSd("fox.bmp",0,0)

Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's CHM Help File Creation Features