Changes between Version 4 and Version 5 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/File/FindFlashDrive
- Timestamp:
- 05/17/24 12:31:23 (6 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Docs/Prog/Manual/ApplicationLibraries/lib825ev/File/FindFlashDrive
v4 v5 22 22 23 23 {{{ 24 int result;25 char writeFilePath[180];24 int result; 25 char writeFilePath[180]; 26 26 #if ARM64 27 vector<string> pathList;28 // pass true to mount the drive if a drive found but not mounted29 if(FindFlashDrive(pathList, true) == false) {30 result = -1;31 } else {32 result = 0;33 // pathList item will already have a trailing slash34 // 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 } 37 37 #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"); 40 40 #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 { 44 44 45 45 // ... Write data to flash drive, or read from the drive 46 46 47 47 #if ARM64 48 UnmountDirectory(pathList[0].c_str());48 UnmountDirectory(pathList[0].c_str()); 49 49 #else 50 system("umount /mnt/fl1");50 system("umount /mnt/fl1"); 51 51 #endif 52 } 53 54 55 52 } 56 53 }}} 57 54