1explain_filename_from_fildesL(i3b)rary Functions Maneuxapllain_filename_from_fildes(3)
2
3
4
6 explain_filename_from_fildes - obtain filename from file descriptor
7
9 #include <libexplain/filename.h>
10 int explain_filename_from_fildes(int fildes, char *data, size_t
11 data_size);
12 int explain_filename_from_stream(FILE *stream, char *data, size_t
13 data_size);
14
16 The explain_filename_from_fildes function may be used to obtain the
17 name of the file associated with the file descriptor.
18
19 The explain_filename_from_stream function may be used to obtain the
20 name of the file associated with a file stream.
21
22 The filename is returned in the array pointed to by data. The filename
23 will always be NUL terminated. If the returned filename is longer than
24 data_size, it will be silently truncated; a size of at least (PATH_MAX
25 + 1) is suggested.
26
27 On success, returns zero. If the file name cannot be determined,
28 returns -1 (but does not set errno.)
29
31 libexplain version 1.4
32 Copyright (C) 2012 Peter Miller
33
35 Written by Peter Miller <pmiller@opensource.org.au>
36
37
38
39 explain_filename_from_fildes(3)