# SD card access, path/directory

**URL:** <https://forum.legato.io/t/sd-card-access-path-directory/5025>\
**Category:** Uncategorized\
**Created:** [February 25, 2020, 1:40pm UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025 "2020-02-25T13:40:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vin883](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@vin883](https://forum.legato.io/u/vin883)\
**Post date:** [February 25, 2020, 1:40pm UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/1 "2020-02-25T13:40:37Z")

</div>

Hi again,

I’m using a SD card on a WP8548 SDIO pins. The code i’m executing says it managed to create a file and write in it, but I don’t know where this file is!

Is there a common path for SD card on SDIO pins? How can I specify this path?

> C code:

#include “legato.h”

COMPONENT\_INIT  
{  
LE\_INFO(“Hello, Vincent.”);  
LE\_INFO(“Test File Creation.”);  
uint8\_t write\_buffer\_tx ={0x54, 0x45, 0x53, 0x54, 0x32};  
le\_result\_t res;  
le\_fs\_FileRef\_t fp;  
size\_t filesize;  
res = le\_fs\_Open(“/test2.txt”, LE\_FS\_CREAT|LE\_FS\_RDWR|LE\_FS\_APPEND|LE\_FS\_SYNC , &fp);  
if(res == LE\_OK)  
{  
LE\_INFO(“File Created Successfully.”);  
}  
else  
{  
LE\_INFO(“File Creation Failed %d.”, res);  
}  
res = le\_fs\_Write(fp, write\_buffer\_tx, NUM\_ARRAY\_MEMBERS(write\_buffer\_tx));  
if(res == LE\_OK)  
{  
LE\_INFO(“File Write Successful.”);  
}  
else  
{  
LE\_INFO(“File Write Failed %d.”, res);  
}  
le\_fs\_Close(fp);  
res = le\_fs\_GetSize(“/test2.txt”, &filesize);

```
if(res == LE_OK)
{
	LE_INFO("File Get Size Successful. size=%d", filesize);
}
else
{
	LE_INFO("File Get Size Failed %d.", res);
}

```

}

> adef file:

sandboxed: true  
version: 1.0.0  
maxFileSystemBytes: 512K  
start: manual

executables:  
{  
hellovincent = ( HelloVincentComponent )  
}

processes:  
{  
envVars:  
{  
LE\_LOG\_LEVEL = DEBUG  
}

```
run:
{
	( hellovincent )
}

faultAction: restart

```

}

requires:  
{  
device:  
{  
// Request read and write access to the SD card.  
[rw] /dev/mmcblk0p1 /dev/mmcblk0p1  
}

dir:  
{  
/mnt/userrw/sdcard /  
}  
}

> Console output

Feb 25 13:22:39 | hellovincent[3083]/hellovincent\_exe T=main | \_main.c main() 60 | == Starting Event Processing Loop ==  
Feb 25 13:22:39 | hellovincent[3083]/HelloVincentComponent T=main | HelloVincentComponent.c \_HelloVincentComponent\_COMPONENT\_INIT() 5 | Hello, Vincent.  
Feb 25 13:22:39 | hellovincent[3083]/HelloVincentComponent T=main | HelloVincentComponent.c \_HelloVincentComponent\_COMPONENT\_INIT() 6 | Test File Creation.  
Feb 25 13:22:39 | hellovincent[3083]/HelloVincentComponent T=main | HelloVincentComponent.c \_HelloVincentComponent\_COMPONENT\_INIT() 14 | File Created Successfully.  
Feb 25 13:22:39 | hellovincent[3083]/HelloVincentComponent T=main | HelloVincentComponent.c \_HelloVincentComponent\_COMPONENT\_INIT() 23 | File Write Successful.  
Feb 25 13:22:39 | hellovincent[3083]/HelloVincentComponent T=main | HelloVincentComponent.c \_HelloVincentComponent\_COMPONENT\_INIT() 34 | File Get Size Successful. size=5

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 25, 2020, 2:15pm UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/2 "2020-02-25T14:15:56Z")

</div>

You can find the file by "find / -name “test2.txt” "

---

<div class="post-metadata">

**Author:** ![vin883](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@vin883](https://forum.legato.io/u/vin883)\
**Post date:** [February 25, 2020, 2:34pm UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/3 "2020-02-25T14:34:06Z")

</div>

Hi jyijyi,

Where do I have to enter this command? (I’m working on developer studio, Windows native OS)

But even If I find this test2.txt file, I’d like to create it on the SD card. How can I achieve this operation?

Thanks,

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 25, 2020, 2:58pm UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/4 "2020-02-25T14:58:33Z")

</div>

You can enter in the console terminal.

---

<div class="post-metadata">

**Author:** ![vin883](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@vin883](https://forum.legato.io/u/vin883)\
**Post date:** [February 25, 2020, 3:49pm UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/5 "2020-02-25T15:49:53Z")

</div>

> [@jyijyi](#):
>
> find / -name “test2.txt”

It found 4 occurences, certainly the results of my multiple attempts 🙂

It seems to be local paths, how can I create this file in my SD card? Thanks

![legato console](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/9f2be2a6779a3782249e356869bbcdf70ff9d83f.jpeg)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 25, 2020, 3:54pm UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/6 "2020-02-25T15:54:31Z")

</div>

I think you should set the sandbox flag to be false.  
When you open file pointer, please specify the absolute file path.

---

<div class="post-metadata">

**Author:** ![vin883](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@vin883](https://forum.legato.io/u/vin883)\
**Post date:** [February 25, 2020, 4:42pm UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/7 "2020-02-25T16:42:04Z")

</div>

When running in unsanboxed mode it gives the same result (see below). I already tested it, which explains the different path found.

Do you know the absolute file path of the SD card?

![legato console2](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/bbf8b94f7fda6b68ff6f5a98ecb843bb64dd6e09.jpeg)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 26, 2020, 1:55am UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/8 "2020-02-26T01:55:57Z")

</div>

you need to mount the SD card first:

root@swi-mdm9x28-wp:~# ls /dev/mmc\*  
/dev/mmcblk0 /dev/mmcblk0p1  
root@swi-mdm9x28-wp:~#  
root@swi-mdm9x28-wp:~# mkdir -p /tmp/sdcard  
root@swi-mdm9x28-wp:~#  
root@swi-mdm9x28-wp:~# /bin/mount -t auto -o sync /dev/mmcblk0p1 “/tmp/sdcard”  
root@swi-mdm9x28-wp:~#  
root@swi-mdm9x28-wp:~# ls /tmp/sdcard/  
DCIM LOST.DIR  
LGBackup System Volume Information  
root@swi-mdm9x28-wp:~#  
root@swi-mdm9x28-wp:~# echo test \> /tmp/sdcard/test.txt  
root@swi-mdm9x28-wp:~#  
root@swi-mdm9x28-wp:~# ls /tmp/sdcard/  
DCIM System Volume Information  
LGBackup test.txt  
LOST.DIR

---

<div class="post-metadata">

**Author:** ![vin883](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@vin883](https://forum.legato.io/u/vin883)\
**Post date:** [February 26, 2020, 8:47am UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/9 "2020-02-26T08:47:01Z")

</div>

> [@jyijyi](#):
>

Thanks a lot jyijyi, you’re really helpful!

I did the commands to “mount” the SD card, it seems ok (see below)

![legato console3](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/c2e85f6aff6f15c663b64396e66613ffa47bb42c.jpeg)

Then I did run the project again it created the text2.txt in a new folder, but unfortunately still outside the SD.

![legato console4](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/88cef1543623759c85246c0cf977e234067de106.jpeg)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 26, 2020, 8:56am UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/10 "2020-02-26T08:56:23Z")

</div>

two solutions:

1. you can use system() API to copy the newly generated file to /tmp/sdcard
2. you can use fopen() with absolute file path instead of le\_fs\_Open()

Please note that you need to set the sandbox flag to be false.

---

<div class="post-metadata">

**Author:** ![vin883](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@vin883](https://forum.legato.io/u/vin883)\
**Post date:** [February 26, 2020, 9:28am UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/11 "2020-02-26T09:28:12Z")

</div>

Ok, Here is the new project:

> C file

#include “legato.h”  
#include\<stdio.h\>

COMPONENT\_INIT  
{  
LE\_INFO(“Hello Vincent2!”);

```
FILE* demo;
char str[] = "Hello!";

// Creates a file "demo_file"
// with file acccess as write-plus mode
demo = fopen("demo.txt", "w+");

fwrite(str , 1 , sizeof(str) , demo);

// closes the file pointed by demo
fclose(demo);

if(demo == NULL)
{
	LE_INFO("File Creation Failed");
}
else
{
	LE_INFO("File Created Successfully");
}

```

}

> adef

sandboxed: false  
version: 1.0.0  
maxFileSystemBytes: 512K  
start: manual

executables:  
{  
hellovincent2 = ( HelloVincent2Component )  
}

processes:  
{  
envVars:  
{  
LE\_LOG\_LEVEL = DEBUG  
}

```
run:
{
	( hellovincent2 )
}

maxCoreDumpFileBytes: 512K
maxFileBytes: 512K

```

}

requires:  
{  
device:  
{  
// Request read and write access to the SD card.  
[rw] /dev/mmcblk0p1 /dev/mmcblk0p1  
}

dir:  
{  
/mnt/userrw/sdcard /  
}  
}

> * * *

Demo.txt file is created but still outside SD card. Maybe the path isn’t correct in : demo = fopen(“demo.txt”, “w+”); ?

![legato console5](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/1X/ce9720ee333906bac92058da6741f4ff3d759dd0.jpeg)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 26, 2020, 9:40am UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/12 "2020-02-26T09:40:44Z")

</div>

have you tried to use absolute path here?  
fopen(“demo.txt”, “w+”);

---

<div class="post-metadata">

**Author:** ![vin883](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@vin883](https://forum.legato.io/u/vin883)\
**Post date:** [February 26, 2020, 9:44am UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/13 "2020-02-26T09:44:29Z")

</div>

No, because… I don’t know it 😅

Is it /mnt/userrw/sdcard / ?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 26, 2020, 9:48am UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/14 "2020-02-26T09:48:10Z")

</div>

didn’t you have mounted the SD card to /tmp/sdcard?

---

<div class="post-metadata">

**Author:** ![vin883](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@vin883](https://forum.legato.io/u/vin883)\
**Post date:** [February 26, 2020, 9:57am UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/15 "2020-02-26T09:57:45Z")

</div>

Ok so I change the previous fopen by: demo = fopen(“/tmp/sdcard/demo.txt”, “w+”);

Execution is aborted and the console says:

> Blockquote

Feb 26 09:54:36 | hellovincent2[1392]/HelloVincent2Component T=main | HelloVincent2Component.c \_HelloVincent2Component\_COMPONENT\_INIT() 6 | Hello Vincent2!  
Feb 26 09:54:36 | hellovincent2[1392] | | PROCESS: 1392 ,TID 1392  
Feb 26 09:54:36 | hellovincent2[1392] | | SIGNAL: 11, ADDR (nil), AT 0xb6d899e8 SI\_CODE 0x00000001  
Feb 26 09:54:36 | hellovincent2[1392] | | ILLEGAL ADDRESS (nil)  
Feb 26 09:54:36 | hellovincent2[1392] | | LEGATO VERSION  
Feb 26 09:54:36 | hellovincent2[1392] | | 18.06.4\_a2b118ed13919cebd20f9d71e8810748\_modified  
Feb 26 09:54:36 | hellovincent2[1392] | |  
Feb 26 09:54:36 | hellovincent2[1392] | | PROCESS COMMAND LINE  
Feb 26 09:54:36 | hellovincent2[1392] | | hellovincent2  
Feb 26 09:54:36 | hellovincent2[1392] | |  
Feb 26 09:54:36 | hellovincent2[1392] | | PROCESS MAP  
Feb 26 09:54:36 | hellovincent2[1392] | | b6d2d000-b6e55000 r-xp 00000000 fe:00 753 /lib/libc-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6e55000-b6e64000 —p 00128000 fe:00 753 /lib/libc-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6e64000-b6e66000 r–p 00127000 fe:00 753 /lib/libc-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6e66000-b6e68000 rw-p 00129000 fe:00 753 /lib/libc-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6e68000-b6e6a000 rw-p 00000000 00:00 0  
Feb 26 09:54:36 | hellovincent2[1392] | | b6e6a000-b6ed8000 r-xp 00000000 fe:00 762 /lib/libm-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6ed8000-b6ee7000 —p 0006e000 fe:00 762 /lib/libm-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6ee7000-b6ee8000 r–p 0006d000 fe:00 762 /lib/libm-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6ee8000-b6ee9000 rw-p 0006e000 fe:00 762 /lib/libm-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6ee9000-b6eeb000 r-xp 00000000 fe:00 759 /lib/libdl-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6eeb000-b6efa000 —p 00002000 fe:00 759 /lib/libdl-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6efa000-b6efb000 r–p 00001000 fe:00 759 /lib/libdl-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6efb000-b6efc000 rw-p 00002000 fe:00 759 /lib/libdl-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6efc000-b6f02000 r-xp 00000000 fe:00 778 /lib/librt-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f02000-b6f11000 —p 00006000 fe:00 778 /lib/librt-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f11000-b6f12000 r–p 00005000 fe:00 778 /lib/librt-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f12000-b6f13000 rw-p 00006000 fe:00 778 /lib/librt-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f13000-b6f29000 r-xp 00000000 fe:00 774 /lib/libpthread-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f29000-b6f38000 —p 00016000 fe:00 774 /lib/libpthread-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f38000-b6f39000 r–p 00015000 fe:00 774 /lib/libpthread-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f39000-b6f3a000 rw-p 00016000 fe:00 774 /lib/libpthread-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f3a000-b6f3c000 rw-p 00000000 00:00 0  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f3c000-b6f8c000 r-xp 00000000 fe:02 398 /mnt/legato/system/lib/liblegato.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f8c000-b6f8d000 rw-p 00050000 fe:02 398 /mnt/legato/system/lib/liblegato.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f8d000-b6f8e000 r-xp 00000000 f4:01 26337 /legato/apps/2bcadb7bba790ad49e74e132c6d7fe7c/read-only/lib/libComponent\_HelloVincent2Component.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f8e000-b6f9d000 —p 00001000 f4:01 26337 /legato/apps/2bcadb7bba790ad49e74e132c6d7fe7c/read-only/lib/libComponent\_HelloVincent2Component.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f9d000-b6f9e000 rw-p 00000000 f4:01 26337 /legato/apps/2bcadb7bba790ad49e74e132c6d7fe7c/read-only/lib/libComponent\_HelloVincent2Component.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6f9e000-b6fbe000 r-xp 00000000 fe:00 745 /lib/ld-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6fc5000-b6fc7000 rw-p 00000000 00:00 0  
Feb 26 09:54:36 | hellovincent2[1392] | | b6fca000-b6fcc000 rw-p 00000000 00:00 0  
Feb 26 09:54:36 | hellovincent2[1392] | | b6fcc000-b6fcd000 r-xp 00000000 00:00 0 [sigpage]  
Feb 26 09:54:36 | hellovincent2[1392] | | b6fcd000-b6fce000 r–p 0001f000 fe:00 745 /lib/ld-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6fce000-b6fcf000 rw-p 00020000 fe:00 745 /lib/ld-2.24.so  
Feb 26 09:54:36 | hellovincent2[1392] | | b6fcf000-b6fd0000 r-xp 00000000 f4:01 26333 /legato/apps/2bcadb7bba790ad49e74e132c6d7fe7c/read-only/bin/hellovincent2  
Feb 26 09:54:36 | hellovincent2[1392] | | b6fe0000-b6fe1000 rw-p 00001000 f4:01 26333 /legato/apps/2bcadb7bba790ad49e74e132c6d7fe7c/read-only/bin/hellovincent2  
Feb 26 09:54:36 | hellovincent2[1392] | | b6fe1000-b7002000 rw-p 00000000 00:00 0 [heap]  
Feb 26 09:54:36 | hellovincent2[1392] | | bebd2000-bebf3000 rw-p 00000000 00:00 0 [stack]  
Feb 26 09:54:36 | hellovincent2[1392] | | ffff0000-ffff1000 r-xp 00000000 00:00 0 [vectors]  
Feb 26 09:54:36 | hellovincent2[1392] | | BACKTRACE  
Feb 26 09:54:36 | hellovincent2[1392] | | PC at b6d899e8  
Feb 26 09:54:36 | hellovincent2[1392] | | LR at b6f8d87c [0xbebf26ec]  
Feb 26 09:54:36 | hellovincent2[1392] | | LR at b6f4f6fc [0xbebf2ab4]  
Feb 26 09:54:36 | hellovincent2[1392] | | LR at b6f50b38 [0xbebf2ad4]  
Feb 26 09:54:36 | hellovincent2[1392] | | LR at b6fcfd10 [0xbebf2cf4]  
Feb 26 09:54:36 | hellovincent2[1392] | | LR at b6d44a7c [0xbebf2d1c]  
Feb 26 09:54:36 | hellovincent2[1392] | | r0 bebf2a9c r1 00000001 r2 00000007 r3 00000000 r4 00000000 r5 00000007  
Feb 26 09:54:36 | hellovincent2[1392] | | r6 00000000 r7 bebf2ae8 r8 b6fe55f8 r9 00000004 r10 b6f8c12c cpsr 20060010  
Feb 26 09:54:36 | hellovincent2[1392] | | fp bebf2ab4 ip b6d899d0 sp bebf2a60 lr b6f8d87c pc b6d899e8  
Feb 26 09:54:36 | hellovincent2[1392] | | STACK bebf2a60, FRAME bebf2ab4  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf29e0: ffffffff 00000000 b6d36eb0 b6fcb848 00000160 00000000 00000005 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2a00: 00000000 00000002 0000002d 0000003d 0000005b b6f8dad1 b6ffcc08 b6f8d000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2a20: 00010d08 b6fc5880 00000000 00000001 00000004 b6f8c12c bebf2ab4 b6fad830  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2a40: b6fcbc80 00000001 00000001 00000000 00000001 b6d36eb0 b6f9dcf0 b6fe55f8  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2a60: 00000000 bebf2ae8 b6fe55f8 b6f9dcf0 b6fe55f8 00000000 bebf2ae8 b6fe55f8  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2a80: 00000004 b6f8d87c b6f8db28 00000006 b6f8dac0 bebf2ac0 00000008 6c6c6548  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2aa0: 0000216f 00000000 b6fe2a4c b6fe2a4c bebf2ad4 b6f4f6fc 00000000 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2ac0: 00000001 bebf2ae8 b6fe55f8 00000004 bebf2cf4 b6f50b38 bebf2b90 b6df9950  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2ae0: b6e66144 b6f8c12c 00000001 00001ffc 00000000 00000000 0000008c 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2b00: 00000000 2829c02d b6fcacd8 b6fe4108 b6f8c9dc b6f85624 bebf2b5c b6f61a78  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2b20: bebf2bc4 b6fa8478 b6e64f44 00000024 00000036 00000009 0000001a 00000001  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2b40: 00000078 00000003 00000038 00000000 00000000 b6fe5980 00000000 00000007  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2b60: b6f3ffa8 00000000 b6fcab20 00000001 b6fcab20 bebf2be0 b6f3d338 000002bb  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2b80: bebf2be4 b6fa7ebc 00000001 b6f3ffa8 000002bb b6f402a8 b6fcab20 bebf2be4  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2ba0: bebf2be0 b6fcfda4 b6fcfe3c b6f402a8 b6f3d3f8 bcdb29c5 05e6d94e b6fcf58c  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2bc0: b6fcf354 bebf2c50 b6fce000 004e2000 aaaaaaab 00000000 b6ffcb0c 00000009  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2be0: 00000000 00000000 676e6973 bcdb29c5 b6fceb10 00000000 bebf2c50 b6fcf58c  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2c00: bebf2c58 bebf2cc4 bebf2cac b6fa8478 bebf2c58 b6fceab4 00000002 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2c20: 00000001 00000000 00000001 b6fce958 00000000 00000000 00000000 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2c40: 00000000 00000000 b6fceb10 b6fce958 ffffffff 00000000 b6f3ffa8 b6fcab20  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2c60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2c80: 00000000 00000000 00000000 b6fcf000 00011170 b6fc5880 00000000 00000001  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2ca0: 00000000 b6fe0134 bebf2d1c b6fad830 00000000 00000001 00000001 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2cc0: 00000000 b6f3ffa8 b6fe0134 00000000 b6fcf96c 00000000 00000000 b6fb4884  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2ce0: b6e66ba4 00000000 00000000 00000000 bebf2d1c b6fcfd10 b6fcfe3c 0000003c  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2d00: b6fcfe0c 00000000 bebf2e74 00000001 00000000 b6fcfd34 00000000 b6d44a7c  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2d20: b6e66400 bebf2e74 00000001 b6fcfc18 b6fcf2d4 bebf2dc0 adeca2c0 a587c5d4  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2d40: b6fcfd34 00000000 b6fcf96c 00000000 00000000 00000000 b6fe0134 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2d60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2d80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2da0: 00000000 b6f4f114 b6f8d7a0 00000000 00000000 b6fb4884 b6fceb10 b6fce958  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2dc0: ffffffff 00000000 b6d39000 b6fcb848 00000001 00000001 b6f8c12c 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2de0: b6f9dbe0 b6f4f310 00000000 b6f4f114 bebf2e0c b6f5098c b6f9dcf0 b6fcf000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2e00: 00011158 b6fc5880 00000000 00000001 00000000 b6fe0134 00000000 b6fad830  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2e20: b6fcbc40 00000001 00000001 00000000 00000000 b6d39000 00000000 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2e40: 00000000 00000000 00000000 b6fb4884 00000000 00000000 b6fcf96c 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2e60: 00000000 b6fcf9b0 b6fcfd94 b6fae8c0 bebf2e74 bebf2f39 00000000 bebf2f47  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2e80: bebf2f5a 00000000 00000010 0001b0d7 00000006 00001000 00000011 00000064  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2ea0: 00000003 b6fcf034 00000004 00000020 00000005 00000008 00000007 74f6e000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2ec0: 00000008 00000000 00000009 b6fcf96c 0000000b 00000000 0000000c 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2ee0: 0000000d 00000000 0000000e 00000000 00000017 00000000 00000019 bebf2f25  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2f00: 0000001f bebf2fb5 0000000f bebf2f35 00000000 00000000 00000000 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2f20: 00000000 b8f26b00 538fe00c 4f3f0413 b41a2ec6 6c37769f 6c656800 69766f6c  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2f40: 6e65636e 4c003274 4f4c5f45 454c5f47 3d4c4556 55424544 41500047 2f3d4854  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2f60: 6167656c 732f6f74 65747379 632f736d 65727275 612f746e 2f737070 6c6c6548  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2f80: 6e69566f 746e6563 65722f32 6f2d6461 2f796c6e 3a6e6962 7273752f 636f6c2f  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2fa0: 622f6c61 2f3a6e69 2f727375 3a6e6962 6e69622f 656c2f00 6f746167 7379732f  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2fc0: 736d6574 7275632f 746e6572 7070612f 65482f73 566f6c6c 65636e69 2f32746e  
Feb 26 09:54:36 | hellovincent2[1392] | | bebf2fe0: 64616572 6c6e6f2d 69622f79 65682f6e 766f6c6c 65636e69 0032746e 00000000  
Feb 26 09:54:36 | hellovincent2[1392] | | […]  
Feb 26 09:54:36 | hellovincent2[1392] | | Abort while dumping the stack  
Feb 26 09:54:36 | hellovincent2[1392] | | DONE  
Feb 26 09:54:36 | supervisor[639]/supervisor T=main | proc.c proc\_SigChildHandler() 2049 | Process ‘hellovincent2’ (PID: 1392) has exited due to signal 11 (Segmentation fault).  
Feb 26 09:54:37 | supervisor[639]/supervisor T=main | app.c app\_SigChildHandler() 3480 | Process ‘hellovincent2’ in app ‘HelloVincent2’ faulted: Ignored.  
Feb 26 09:54:37 | \_appStopClient[1394]/framework T=main | LE\_FILENAME CreateSocket() 550 | Socket opened as standard i/o file descriptor 2!  
Feb 26 09:54:37 | supervisor[639]/supervisor T=main | apps.c DeactivateAppContainer() 374 | Application ‘HelloVincent2’ has stopped.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 26, 2020, 10:06am UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/16 "2020-02-26T10:06:47Z")

</div>

how about using system() API?

system(“cp /legato/systems/current/appsWriteable/HelloVincent2/demo.txt /tmp/sdcard” );

---

<div class="post-metadata">

**Author:** ![vin883](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@vin883](https://forum.legato.io/u/vin883)\
**Post date:** [February 26, 2020, 1:42pm UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/17 "2020-02-26T13:42:15Z")

</div>

Actually it works with demo = fopen(“/tmp/sdcard/demo.txt”, “w+”); !!

I just didn’t understand that I had to do the “mount” instructions before executing the app… 🙂

Is there a way to include these mount instructions in my HelloVincentComponent.c file?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 26, 2020, 1:57pm UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/18 "2020-02-26T13:57:06Z")

</div>

Use system() API to mount it

---

<div class="post-metadata">

**Author:** ![vin883](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@vin883](https://forum.legato.io/u/vin883)\
**Post date:** [February 26, 2020, 2:23pm UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/19 "2020-02-26T14:23:56Z")

</div>

Thanks again, jyijyi.

Sorry for the newbie question but I know nothing about system() API function and did not find anything (syntax, arguments, etc.) on legato API guide 😪

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 26, 2020, 2:48pm UTC](https://forum.legato.io/t/sd-card-access-path-directory/5025/20 "2020-02-26T14:48:27Z")

</div>

This is linux API, not related to legato.  
system(“/bin/mount -t auto -o sync /dev/mmcblk0p1 "/tmp/sdcard"”);

[Next page](https://forum.legato.io/t/sd-card-access-path-directory/5025.md?page=2)
