# FileHandler is dropped, when providing app is called from commandLine

**URL:** <https://forum.legato.io/t/filehandler-is-dropped-when-providing-app-is-called-from-commandline/5449>\
**Category:** Legato Application Framework\
**Created:** [October 13, 2020, 11:11am UTC](https://forum.legato.io/t/filehandler-is-dropped-when-providing-app-is-called-from-commandline/5449 "2020-10-13T11:11:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank\_W](https://avatars.discourse-cdn.com/v4/letter/f/b782af/32.png) [@Frank\_W](https://forum.legato.io/u/Frank_W)\
**Post date:** [October 13, 2020, 11:11am UTC](https://forum.legato.io/t/filehandler-is-dropped-when-providing-app-is-called-from-commandline/5449/1 "2020-10-13T11:11:05Z")

</div>

Hi there,

I have an issue when starting an app directly.

**Scenario**

- I have 2 apps.
- App 1 opens a file and provides the filehandler to App2.
- App2 processes the file.
- App 1 shall be called via the commandline from its real location

> /legato/systems/current/appsWriteable/myApp1/bin/myApp1

**Issue**  
When calling App2 from App1, the filehandler is dropped with the message

> “Ancillary data was discarded because it couldn’t fit in our buffer.”

This **only** happens, when I call the app from its original path. When I call

> _app start App1_

the filehandler is properly forwarded.

**Remarks**

- I want to provide the fileName by commandLine, that’s why I can’t call _app start App1_.(for the test, that’s deactivated)
- I’m using Legato Framework 18.10.3 and for the moment, I can’t upgrade to the new legato.
- I tried to rename the app at it’s original path which caused _app start App1_ to fail; so I’m definitely calling the right path.
- I’m using “open(” and “close(” instead of the legato-equivalents. Don’t know if this is of any importance.

Would be happy about any ideas or suggestions how to fix this issue.

Thanks for reading and any answer

---

<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:** [October 13, 2020, 12:10pm UTC](https://forum.legato.io/t/filehandler-is-dropped-when-providing-app-is-called-from-commandline/5449/2 "2020-10-13T12:10:09Z")

</div>

not quite recommend directly running the app on its real location, you should use “app start” to run the application.

you can have a look on this sample application about how to pass argument to application:

> <https://github.com/legatoproject/legato-af/blob/master/apps/sample/modemDemo/sendComponent/send.c>

To run the application, you need to use “app runProc”  
e.g.  
app runProc modemDemo1 send --exe=send – 1234567 “Status”

---

<div class="post-metadata">

**Author:** ![Frank\_W](https://avatars.discourse-cdn.com/v4/letter/f/b782af/32.png) [@Frank\_W](https://forum.legato.io/u/Frank_W)\
**Post date:** [October 14, 2020, 8:22pm UTC](https://forum.legato.io/t/filehandler-is-dropped-when-providing-app-is-called-from-commandline/5449/3 "2020-10-14T20:22:20Z")

</div>

Thank you, that fixed my issue 🙂
