---
name: "ifdstream"
section: "3bobcat"
platform: "linux"
package: "libbobcat-dev"
version: "6.07.01-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ifdstream"
---

# ifdstream(3bobcat)

Input Stream initialized by a File Descriptor

## NAME

FBB::Ifdstream - Input Stream initialized by a File Descriptor

## SYNOPSIS

**#include \<bobcat/ifdstream\>** (when using **FBB::IFdStream**\
 **#include \<bobcat/ifdstreams\>** (when using **FBB::IFdStreamS**

Linking option: *-lbobcat*

## DESCRIPTION

**FBB::IFdStream** objects are used to extract information from devices whose file descriptors are available.

**FBB::IFdStreamS** objects operate like **FBB::IFdStream** objects but use **FBB::Selector** objects to check whether information on the object’s file descriptor is available before reading information from the file descriptor.

File descriptors are not defined within the context of **C++**, but they can be used on operating systems that support the concept. Realize that using file descriptors introduces operating system dependencies.

Note that *sockets* can be used as file descriptors.

## NAMESPACE

**FBB**\
 All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace **FBB**.

## INHERITS FROM

**std::istream**

## CONSTRUCTORS

- o

  **IFdStream(int fd, size\_t n = 1)**:\
   The constructor initializes the object to read from descriptor *fd*, using a buffer of size *n*, by default having size 1.\
   Use **IFdStreamS**(int fd, size\_t n = 1) to construct an *IFdStreamS* object.

Copy and move constructors (and assignment operators) are not available.

## MEMBER FUNCTIONS

All members of **std::istream** are available, as **FBB::IFdStream(S)** inherits from this class. There are no additional members.

## EXAMPLE

See the [**clientsocket**(3bobcat)](/clientsocket/3bobcat.md) man-page for an example showing how to use *IFdStream*.

## FILES

*bobcat/ifdstream* - defines the **FBB::IFdStream** class interface\
 *bobcat/ifdstreams* - defines the **FBB::IFdStreamS** class interface

## SEE ALSO

[**bobcat**(7)](/bobcat/7.md), [**ifdbuf**(3bobcat)](/ifdbuf/3bobcat.md), [**ofdstream**(3bobcat)](/ofdstream/3bobcat.md),  [**selector**(3bobcat)](/selector/3bobcat.md)

## BUGS

The *IFdStream(S)* object uses an *IFdBuf(S)* for its *std::streambuf*. This buffer is associated with the file descriptor passed to *IFdStream(S)*’s constructor. When the *IFdStream(S)* object goes out of scope the device (file, socket, etc.) to which the file descriptor that was passed to *IFdStream(S)*’s constructor is *not* closed.

## BOBCAT PROJECT FILES

- o

  *https://fbb-git.gitlab.io/bobcat/*: gitlab project page;

Debian Bobcat project files:

- o

  *libbobcat6*: debian package containing the shared library, changelog and copyright note;

- o

  *libbobcat-dev*: debian package containing the static library, headers, manual pages, and developer info;

## BOBCAT

Bobcat is an acronym of \`Brokken’s Own Base Classes And Templates’.

## COPYRIGHT

This is free software, distributed under the terms of the GNU General Public License (GPL).

## AUTHOR

Frank B. Brokken (**f.b.brokken@rug.nl**).
