# fdMonitor only works sporadically

**URL:** <https://forum.legato.io/t/fdmonitor-only-works-sporadically/6438>\
**Category:** Legato Application Framework\
**Created:** [February 22, 2023, 12:44pm UTC](https://forum.legato.io/t/fdmonitor-only-works-sporadically/6438 "2023-02-22T12:44:44Z")\
**Posts on this page:** 1\
**Showing post:** 37

<div class="post-metadata">

**Author:** ![HudriWudri](https://avatars.discourse-cdn.com/v4/letter/h/a6a055/32.png) [@HudriWudri](https://forum.legato.io/u/HudriWudri)\
**Post date:** [March 14, 2023, 6:45am UTC](https://forum.legato.io/t/fdmonitor-only-works-sporadically/6438/37 "2023-03-14T06:45:39Z")

</div>

Of course it works for you, you don’t have a broken device 😉

So here’s what we further found out. We had this self-written file-helper (files attached) which was used by our monitoring-app to create the files which are required by other apps (as stated here: [Bundle required files - #7 by HudriWudri](https://forum.legato.io/t/bundle-required-files/6406/7)).

The code with which we initialized the files looked like this. (The opened filed was never closed, but we fixed that later on).

```c
static void initRequiredFiles(void)
{
    File_Open(CELL_INFO_FILE_PATH_TO, File_OpenOptionEnumWrite);
    File_Copy(EXAMPLE_FILE_PATH_FROM, HOME_ROOT_PATH "/" EXAMPLE_FILE_PATH_TO, false);
}

```

We think that especially the File\_Copy function caused problems and **for some reason broke the whole device!** How could that happen??? Do you see any reason for that?

[file-helper.zip](https://forum.legato.io/uploads/short-url/f1HNuktC9CvdUlqdngYfxWFP2fs.zip) (1.5 KB)

---

_[View the full topic](https://forum.legato.io/t/fdmonitor-only-works-sporadically/6438)._
