# Read adef parameters from application?

**URL:** <https://forum.legato.io/t/read-adef-parameters-from-application/5944>\
**Category:** Uncategorized\
**Created:** [August 25, 2021, 2:44pm UTC](https://forum.legato.io/t/read-adef-parameters-from-application/5944 "2021-08-25T14:44:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [August 25, 2021, 2:44pm UTC](https://forum.legato.io/t/read-adef-parameters-from-application/5944/1 "2021-08-25T14:44:57Z")

</div>

Is is possible for an application to read a parameter specified in its adef file, e.g. maxFileBytes, at run time?

---

<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:** [August 25, 2021, 3:24pm UTC](https://forum.legato.io/t/read-adef-parameters-from-application/5944/2 "2021-08-25T15:24:07Z")

</div>

How about this?

root@swi-mdm9x15:/legato/systems/current# config get /apps/hello2/cpuShare  
1024

You can also see here:

> [@About config tree API](https://forum.legato.io/t/about-config-tree-api/250):
>
> Hi, I can get the cpuShare parameter of my application hello2 by typing the following in the console: root@swi-mdm9x15:/legato/systems/current# config get /apps/hello2/cpuShare 1024 However, I cannot get it inside the application code. I have added the following in the adef file: requires: { configTree: { [rw] . } } [code]#include “legato.h” #include “interfaces.h” COMPONENT\_INIT { LE\_INFO(“Hello, world.2”); le\_cfg\_IteratorRef\_t iteratorRef = le\_cfg\_CreateReadTxn("/apps/hello2…

---

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [August 25, 2021, 7:11pm UTC](https://forum.legato.io/t/read-adef-parameters-from-application/5944/3 "2021-08-25T19:11:37Z")

</div>

Does Legato automatically build a config tree with the adef parameters? I don’t see this in the documentation.

---

<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:** [August 25, 2021, 9:38pm UTC](https://forum.legato.io/t/read-adef-parameters-from-application/5944/4 "2021-08-25T21:38:49Z")

</div>

I think so, are you able to find those parameters like below?

root@swi-mdm9x15:/legato/systems/current# config get /apps/hello2/cpuShare  
1024

---

<div class="post-metadata">

**Author:** ![piinst](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@piinst](https://forum.legato.io/u/piinst)\
**Post date:** [August 26, 2021, 2:47pm UTC](https://forum.legato.io/t/read-adef-parameters-from-application/5944/5 "2021-08-26T14:47:31Z")

</div>

Thanks, after I understood the “directory” structure I was able to find the adef parameters. Just execute this first:

```auto
root@swi-mdm9x28-wp:~# config get /apps/*yourappname*

```
