> For the complete documentation index, see [llms.txt](https://sharafat.gitbook.io/c/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sharafat.gitbook.io/c/intermidiate/file-management/error-handling.md).

# Error handling

Testing a file is available or not,

```c
#include <stdio.h>

int main()
{
    FILE* fp;
    char c[16];

    fp = fopen("file1.txt", "r"); // using write mode
    if (fp == NULL)
        printf("File not found!");
    return 0;
}
```
