Changes between Version 4 and Version 5 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/File/FindFlashDrive


Ignore:
Timestamp:
05/17/24 12:31:23 (6 months ago)
Author:
Don Wilson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/Prog/Manual/ApplicationLibraries/lib825ev/File/FindFlashDrive

    v4 v5  
    2222
    2323{{{
    24   int result;
    25   char writeFilePath[180];
     24   int result;
     25   char writeFilePath[180];
    2626#if ARM64
    27   vector<string> pathList;
    28   // pass true to mount the drive if a drive found but not mounted
    29   if(FindFlashDrive(pathList, true) == false) {
    30     result = -1;
    31   } else {
    32     result = 0;
    33     // pathList item will already have a trailing slash
    34     // so writeFilePath will become something like "/run/media/sda1/data.csv"
    35     sprintf_s(writeFilePath, "%sdata.csv", pathList[0].c_str());
    36   }
     27   vector<string> pathList;
     28   // pass true to mount the drive if a drive found but not mounted
     29   if(FindFlashDrive(pathList, true) == false) {
     30      result = -1;
     31   } else {
     32      result = 0;
     33      // pathList item will already have a trailing slash
     34      // so writeFilePath will become something like "/run/media/sda1/data.csv"
     35      sprintf_s(writeFilePath, "%sdata.csv", pathList[0].c_str());
     36   }
    3737#else
    38   result = system("mount -t vfat /dev/sda1 /mnt/fl1");
    39   strcpy(writeFilePath, "/mnt/fl1/data.csv");
     38   result = system("mount -t vfat /dev/sda1 /mnt/fl1");
     39   strcpy(writeFilePath, "/mnt/fl1/data.csv");
    4040#endif
    41   if(result != 0) {
    42      DrawErrorBox("Error mounting USB drive", 2);
    43   } else {
     41   if(result != 0) {
     42      DrawErrorBox("Error mounting USB drive", 2);
     43   } else {
    4444
    4545      // ... Write data to flash drive, or read from the drive
    4646
    4747#if ARM64
    48     UnmountDirectory(pathList[0].c_str());
     48      UnmountDirectory(pathList[0].c_str());
    4949#else
    50     system("umount /mnt/fl1");
     50      system("umount /mnt/fl1");
    5151#endif
    52   }
    53 
    54 
    55 
     52   }
    5653}}}
    5754