1/* 2 * Copyright 2011-2014 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Tyler Dauwalder 7 * Ingo Weinhold, bonefish@users.sf.net 8 * Axel Dörfler, axeld@pinc-software.de 9 * John Scipione, jscipione@gmail.com 10 * 11 * Corresponds to: 12 * headers/os/storage/Directory.h hrev47402 13 * src/kits/storage/Directory.cpp hrev47402 14 */ 15 16 17/*! 18 \file Directory.h 19 \ingroup storage 20 \ingroup libbe 21 \brief Provides the BDirectory class. 22*/ 23 24 25/*! 26 \class BDirectory 27 \ingroup storage 28 \ingroup libbe 29 \brief A directory in the file system. 30 31 \since BeOS R3 32*/ 33 34 35/*! 36 \fn BDirectory::BDirectory() 37 \brief Creates an uninitialized BDirectory object. 38 39 \since BeOS R3 40*/ 41 42 43/*! 44 \fn BDirectory::BDirectory(const BDirectory& dir) 45 \brief Creates a copy of the supplied BDirectory object. 46 47 \param dir The BDirectory object to be copied. 48 49 \since BeOS R3 50*/ 51 52 53/*! 54 \fn BDirectory::BDirectory(const entry_ref* ref) 55 \brief Creates a BDirectory and initializes it to the directory referred 56 to by the supplied entry_ref. 57 58 \param ref The entry_ref that refers to the directory. 59 60 \since BeOS R3 61*/ 62 63 64/*! 65 \fn BDirectory::BDirectory(const node_ref* nref) 66 \brief Creates a BDirectory and initializes it to the directory referred 67 to by the supplied node_ref. 68 69 \param nref The node_ref that refers to the directory. 70 71 \since BeOS R3 72*/ 73 74 75/*! 76 \fn BDirectory::BDirectory(const BEntry* entry) 77 \brief Creates a BDirectory and initializes it to the directory referred 78 to by the supplied BEntry. 79 80 \param entry The BEntry that refers to the directory. 81 82 \since BeOS R3 83*/ 84 85 86/*! 87 \fn BDirectory::BDirectory(const char* path) 88 \brief Creates a BDirectory and initializes it to the directory referred 89 to by the supplied \a path name. 90 91 \param path The \a path name of the directory. 92 93 \since BeOS R3 94*/ 95 96 97/*! 98 \fn BDirectory::BDirectory(const BDirectory* dir, const char* path) 99 \brief Creates a BDirectory and initializes it to the directory referred 100 to by the supplied path name relative to the specified BDirectory. 101 102 \param dir The base BDirectory object. 103 \param path The \a path of the directory relative to \a dir 104 105 \since BeOS R3 106*/ 107 108 109/*! 110 \fn BDirectory::~BDirectory() 111 \brief Destroys the BDirectory object. 112 113 If the BDirectory is properly initialized, the directory's file descriptor 114 is closed. 115 116 \since BeOS R3 117*/ 118 119 120/*! 121 \fn status_t BDirectory::SetTo(const entry_ref* ref) 122 \brief Re-initializes the BDirectory to the directory referred to by the 123 supplied entry_ref. 124 125 \param ref The entry_ref referring to the directory. 126 127 \returns A status code. 128 \retval B_OK Everything went fine. 129 \retval B_BAD_VALUE \c NULL \a ref. 130 \retval B_ENTRY_NOT_FOUND Directory not found. 131 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 132 \retval B_NO_MEMORY Insufficient memory for operation. 133 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 134 \retval B_BUSY A node was busy. 135 \retval B_FILE_ERROR A general file error. 136 \retval B_NO_MORE_FDS The application has run out of file descriptors. 137 138 \since BeOS R3 139*/ 140 141 142/*! 143 \fn status_t BDirectory::SetTo(const node_ref* nref) 144 \brief Re-initializes the BDirectory to the directory referred to by the 145 supplied node_ref. 146 147 \param nref The node_ref referring to the directory. 148 149 \returns A status code. 150 \retval B_OK Everything went fine. 151 \retval B_BAD_VALUE \c NULL \a nref. 152 \retval B_ENTRY_NOT_FOUND Directory not found. 153 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 154 \retval B_NO_MEMORY Insufficient memory for operation. 155 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 156 \retval B_BUSY A node was busy. 157 \retval B_FILE_ERROR A general file error. 158 \retval B_NO_MORE_FDS The application has run out of file descriptors. 159 160 \since BeOS R3 161*/ 162 163 164/*! 165 \fn status_t BDirectory::SetTo(const BEntry* entry) 166 \brief Re-initializes the BDirectory to the directory referred to by the 167 supplied BEntry. 168 169 \param entry The BEntry referring to the directory. 170 171 \returns A status code. 172 \retval B_OK Everything went fine. 173 \retval B_BAD_VALUE \c NULL \a entry. 174 \retval B_ENTRY_NOT_FOUND Directory not found. 175 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 176 \retval B_NO_MEMORY Insufficient memory for operation. 177 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 178 \retval B_BUSY A node was busy. 179 \retval B_FILE_ERROR A general file error. 180 \retval B_NO_MORE_FDS The application has run out of file descriptors. 181 182 \since BeOS R3 183*/ 184 185 186/*! 187 \fn status_t BDirectory::SetTo(const char* path) 188 \brief Re-initializes the BDirectory to the directory referred to by the 189 supplied path name. 190 191 \param path The directory's \a path name. 192 193 \returns A status code. 194 \retval B_OK Everything went fine. 195 \retval B_BAD_VALUE \c NULL \a path. 196 \retval B_ENTRY_NOT_FOUND Directory not found. 197 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 198 \retval B_NO_MEMORY Insufficient memory for operation. 199 \retval B_NAME_TOO_LONG The supplied path name (\a path) is too long. 200 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 201 \retval B_BUSY A node was busy. 202 \retval B_FILE_ERROR A general file error. 203 \retval B_NO_MORE_FDS The application has run out of file descriptors. 204 \retval B_NOT_A_DIRECTORY \a path includes a non-directory. 205 206 \since BeOS R3 207*/ 208 209 210/*! 211 \fn status_t BDirectory::SetTo(const BDirectory* dir, const char* path) 212 \brief Re-initializes the BDirectory to the directory referred to by the 213 supplied path name relative to the specified BDirectory. 214 215 \param dir The base directory. 216 \param path The directory path name relative to \a dir. 217 218 \returns A status code. 219 \retval B_OK Everything went fine. 220 \retval B_BAD_VALUE \c NULL \a dir or \a path, or \a path is absolute. 221 \retval B_ENTRY_NOT_FOUND Directory not found. 222 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 223 \retval B_NO_MEMORY Insufficient memory for operation. 224 \retval B_NAME_TOO_LONG The supplied path name (\a path) is too long. 225 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 226 \retval B_BUSY A node was busy. 227 \retval B_FILE_ERROR A general file error. 228 \retval B_NO_MORE_FDS The application has run out of file descriptors. 229 \retval B_NOT_A_DIRECTORY \a path includes a non-directory. 230 231 \since BeOS R3 232*/ 233 234 235/*! 236 \fn status_t BDirectory::GetEntry(BEntry* entry) const 237 \brief Gets a BEntry object referring to the directory. If the 238 initialization of \a entry fails, it is Unset(). 239 240 \param entry A pointer to the \a entry that will refer to the directory. 241 242 \returns A status code. 243 \retval B_OK Everything went fine. 244 \retval B_BAD_VALUE \c NULL \a entry. 245 \retval B_ENTRY_NOT_FOUND Directory not found. 246 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 247 \retval B_NO_MEMORY Insufficient memory for operation. 248 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 249 \retval B_BUSY A node was busy. 250 \retval B_FILE_ERROR A general file error. 251 \retval B_NO_MORE_FDS The application has run out of file descriptors. 252 253 \since BeOS R3 254*/ 255 256 257/*! 258 \fn bool BDirectory::IsRootDirectory() const 259 \brief Returns whether the directory is the root directory of a volume. 260 261 \returns \c true if the BDirectory is properly initialized and represents 262 a root directory of a volume, \c false otherwise. 263 264 \since BeOS R3 265*/ 266 267 268/*! 269 \fn status_t BDirectory::FindEntry(const char* path, BEntry* entry, 270 bool traverse) const 271 \brief Finds an entry referred to by a path relative to the directory 272 represented by this BDirectory. 273 274 \a path may represent an absolute path. If the BDirectory is not properly 275 initialized then the entry is relative to the current directory. If the 276 entry couldn't be found, \a entry is Unset(). 277 278 \note The functionality of this method differs from 279 BEntry::SetTo(BDirectory *, const char *, bool) in that it doesn't 280 require the entry to exist, whereas this method does. 281 282 \param path The entry's \a path name. May be relative to this directory 283 or an absolute path. 284 \param entry A pointer to a BEntry to be initialized with the found entry. 285 \param traverse Whether or not to follow a symbolic link. 286 287 \returns A status code. 288 \retval B_OK Everything went fine. 289 \retval B_BAD_VALUE \c NULL \a path or \a entry. 290 \retval B_ENTRY_NOT_FOUND Entry not found. 291 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 292 \retval B_NO_MEMORY Insufficient memory for operation. 293 \retval B_NAME_TOO_LONG The supplied path name (\a path) is too long. 294 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 295 \retval B_BUSY A node was busy. 296 \retval B_FILE_ERROR A general file error. 297 \retval B_NO_MORE_FDS The application has run out of file descriptors. 298 \retval B_NOT_A_DIRECTORY \a path includes a non-directory. 299 300 \sa BEntry::SetTo(BDirectory *, const char *, bool) 301 302 \since BeOS R3 303*/ 304 305 306/*! 307 \fn bool BDirectory::Contains(const char* path, int32 nodeFlags) const 308 \brief Returns whether or not this directory or any of its subdirectories 309 at any level contain the entry referred to by the supplied path 310 name. 311 312 Only entries that match the node flavor specified by \a nodeFlags are 313 considered. 314 315 If the BDirectory is not properly initialized, the method returns 316 \c false. A non-absolute path is considered relative to the current 317 directory. 318 319 \note BeOS R5's implementation always returns \c true given an absolute 320 path or an initialized directory. This implementation is not 321 compatible with that behavior. Instead it converts the path into 322 a BEntry and passes it to the other version of Contains(). 323 324 \param path The entry's \a path name. May be relative to this directory 325 or may be an absolute \a path. 326 \param nodeFlags Any of the following: 327 - \c B_FILE_NODE: The entry must be a file. 328 - \c B_DIRECTORY_NODE: The entry must be a directory. 329 - \c B_SYMLINK_NODE: The entry must be a symbolic link. 330 - \c B_ANY_NODE: The entry may be of any kind. 331 332 \returns \c true if the entry exists and its kind does match \a nodeFlags 333 and the BDirectory is properly initialized and does contain the 334 entry at any level, \c false otherwise. 335 336 \since BeOS R3 337*/ 338 339 340/*! 341 \fn bool BDirectory::Contains(const BEntry* entry, int32 nodeFlags) const 342 \brief Returns whether or not this directory or any of its subdirectories 343 at any level contain the entry referred to by the supplied BEntry. 344 345 Only entries that match the node flavor specified by \a nodeFlags are 346 considered. 347 348 \note If the paths are identical, this method returns \c true to stay 349 consistent with BeOS 5. 350 351 \param entry a BEntry referring to the entry 352 \param nodeFlags Any of the following: 353 - \c B_FILE_NODE: The entry must be a file. 354 - \c B_DIRECTORY_NODE: The entry must be a directory. 355 - \c B_SYMLINK_NODE: The entry must be a symbolic link. 356 - \c B_ANY_NODE: The entry may be of any kind. 357 358 \returns \c true if the BDirectory is properly initialized and the 359 entry of the matching kind was found, \c false otherwise. 360 361 \since BeOS R3 362*/ 363 364 365/*! 366 \fn status_t BDirectory::GetStatFor(const char* path, struct stat* st) const 367 \brief Returns the stat structure of the entry referred to by the supplied 368 path name. 369 370 \param path The entry's path name. May be relative to this directory or 371 absolute, or \c NULL to get the directories stat info. 372 \param st A pointer to the stat structure to be filled in by this method. 373 374 \returns A status code. 375 \retval B_OK Everything went fine. 376 \retval B_BAD_VALUE \c NULL \a st. 377 \retval B_ENTRY_NOT_FOUND Entry not found. 378 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 379 \retval B_NO_MEMORY Insufficient memory for operation. 380 \retval B_NAME_TOO_LONG The supplied path name (\a path) is too long. 381 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 382 \retval B_BUSY A node was busy. 383 \retval B_FILE_ERROR A general file error. 384 \retval B_NO_MORE_FDS The application has run out of file descriptors. 385 \retval B_NOT_A_DIRECTORY \a path includes a non-directory. 386 387 \since BeOS R3 388*/ 389 390 391/*! 392 \fn status_t BDirectory::GetNextEntry(BEntry* entry, bool traverse) 393 \brief Returns the next entry as a BEntry object. 394 395 Unlike GetNextDirents() this method ignores "." and "..". 396 397 \note The iterator used by this method is the same one used by 398 GetNextRef(), GetNextDirents(), Rewind() and CountEntries(). 399 400 \param entry A pointer to a BEntry to be initialized to the found entry 401 \param traverse Specifies whether or not to follow a symbolic link. 402 403 \returns A status code. 404 \retval B_OK Everything went fine. 405 \retval B_BAD_VALUE \c NULL \a entry. 406 \retval B_ENTRY_NOT_FOUND No more entries found. 407 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 408 \retval B_NO_MEMORY Insufficient memory for operation. 409 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 410 \retval B_BUSY A node was busy. 411 \retval B_FILE_ERROR A general file error. 412 \retval B_NO_MORE_FDS The application has run out of file descriptors. 413 414 \since BeOS R3 415*/ 416 417 418/*! 419 \fn status_t BDirectory::GetNextRef(entry_ref* ref) 420 \brief Returns the BDirectory's next entry as an entry_ref. 421 422 Unlike GetNextDirents() this method ignores "." and "..". 423 424 \note The iterator used be this method is the same one used by 425 GetNextEntry(), GetNextDirents(), Rewind() and CountEntries(). 426 427 \param ref A pointer to an entry_ref to be filled in with the data 428 from the found entry. 429 430 \returns A status code. 431 \retval B_OK Everything went fine. 432 \retval B_BAD_VALUE \c NULL \a ref. 433 \retval B_ENTRY_NOT_FOUND No more entries found. 434 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 435 \retval B_NO_MEMORY Insufficient memory for operation. 436 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 437 \retval B_BUSY A node was busy. 438 \retval B_FILE_ERROR A general file error. 439 \retval B_NO_MORE_FDS The application has run out of file descriptors. 440 441 \since BeOS R3 442*/ 443 444 445/*! 446 \fn int32 BDirectory::GetNextDirents(dirent* buf, size_t bufSize, 447 int32 count) 448 \brief Returns the next entries of the BDirectory object as a pointer 449 to dirent structures. 450 451 Unlike GetNextEntry() and GetNextRef(), this method returns also 452 the entries "." and "..". 453 454 \note The iterator used by this method is the same one used by 455 GetNextEntry(), GetNextRef(), Rewind() and CountEntries(). 456 457 \param buf A pointer to a buffer filled with dirent structures containing 458 the found entries. 459 \param bufSize The size of \a buf. 460 \param count The maximum number of entries to be returned. 461 462 \returns The number of dirent structures stored in the buffer, 0 when 463 there are no more entries to be returned or a status code on 464 error. 465 \retval B_BAD_VALUE \c NULL \a buf. 466 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 467 \retval B_NO_MEMORY Insufficient memory for operation. 468 \retval B_NAME_TOO_LONG The entry's name is too long for the buffer. 469 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 470 \retval B_BUSY A node was busy. 471 \retval B_FILE_ERROR A general file error. 472 \retval B_NO_MORE_FDS The application has run out of file descriptors. 473 474 \since BeOS R3 475*/ 476 477 478/*! 479 \fn status_t BDirectory::Rewind() 480 \brief Rewinds the directory iterator. 481 482 \returns A status code. 483 \retval B_OK Everything went fine. 484 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 485 \retval B_NO_MEMORY Insufficient memory for operation. 486 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 487 \retval B_BUSY A node was busy. 488 \retval B_FILE_ERROR A general file error. 489 \retval B_NO_MORE_FDS The application has run out of file descriptors. 490 491 \sa BDirectory::GetNextEntry() 492 \sa BDirectory::GetNextRef() 493 \sa BDirectory::GetNextDirents() 494 \sa BDirectory::CountEntries() 495 496 \since BeOS R3 497*/ 498 499 500/*! 501 \fn int32 BDirectory::CountEntries() 502 \brief Returns the number of entries in this directory. 503 504 CountEntries() uses the directory iterator also used by GetNextEntry(), 505 GetNextRef() and GetNextDirents(). It does a Rewind(), iterates through 506 the entries and Rewind()s again. The entries "." and ".." are not counted. 507 508 \returns The number of entries in the directory (not counting "." and 509 "..") or a status code on error. 510 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 511 \retval B_NO_MEMORY Insufficient memory for operation. 512 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 513 \retval B_BUSY A node was busy. 514 \retval B_FILE_ERROR A general file error. 515 \retval B_NO_MORE_FDS The application has run out of file descriptors. 516 517 \sa BDirectory::GetNextEntry() 518 \sa BDirectory::GetNextRef() 519 \sa BDirectory::GetNextDirents() 520 \sa BDirectory::Rewind() 521 522 \since BeOS R3 523*/ 524 525 526/*! 527 \fn status_t BDirectory::CreateDirectory(const char* path, BDirectory* dir) 528 \brief Creates a new directory. 529 530 If an entry with the supplied name already exists this method returns 531 an error status code. 532 533 \param path The new path name of the directory. May be a relative 534 path to this directory or an absolute path. 535 \param dir A pointer to a BDirectory to be initialized to the newly 536 created directory. May be \c NULL. 537 538 \returns A status code. 539 \retval B_OK Everything went fine. 540 \retval B_BAD_VALUE \c NULL \a path. 541 \retval B_ENTRY_NOT_FOUND \a path does not refer to a possible entry. 542 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 543 \retval B_NO_MEMORY Insufficient memory for operation. 544 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 545 \retval B_BUSY A node was busy. 546 \retval B_FILE_ERROR A general file error. 547 \retval B_FILE_EXISTS An entry with that name does already exist. 548 \retval B_NO_MORE_FDS The application has run out of file descriptors. 549 550 \since BeOS R3 551*/ 552 553 554/*! 555 \fn status_t BDirectory::CreateFile(const char* path, BFile* file, 556 bool failIfExists) 557 \brief Creates a new file. 558 559 If a file with the supplied name does already exist, the method fails, 560 unless it is passed \c false to \a failIfExists -- in that case the file 561 is truncated to zero size. The new BFile will operate in \c B_READ_WRITE 562 mode. 563 564 \param path The new file's path name. May be relative to this 565 directory or an absolute path. 566 \param file A pointer to a BFile to be initialized to the newly 567 created file. May be \c NULL. 568 \param failIfExists Whether or not to fail if the file already exists. 569 570 \returns A status code. 571 \retval B_OK Everything went fine. 572 \retval B_BAD_VALUE \c NULL \a path. 573 \retval B_ENTRY_NOT_FOUND \a path does not refer to a possible entry. 574 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 575 \retval B_NO_MEMORY Insufficient memory for operation. 576 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 577 \retval B_BUSY A node was busy. 578 \retval B_FILE_ERROR A general file error. 579 \retval B_FILE_EXISTS A file with that name does already exist and 580 \c true has been passed for \a failIfExists. 581 \retval B_IS_A_DIRECTORY A directory with the supplied name already 582 exists. 583 \retval B_NO_MORE_FDS The application has run out of file descriptors. 584 585 \since BeOS R3 586*/ 587 588 589/*! 590 \fn status_t BDirectory::CreateSymLink(const char* path, 591 const char* linkToPath, BSymLink* link) 592 \brief Creates a new symbolic link. 593 594 This method fails if an entry with the supplied name already exists. 595 596 \param path the new symbolic link's path name. May be relative to this 597 directory or absolute. 598 \param linkToPath the path the symbolic link shall point to. 599 \param link a pointer to a BSymLink to be initialized to the newly 600 created symbolic link. May be \c NULL. 601 602 \returns A status code. 603 \retval B_OK Everything went fine. 604 \retval B_BAD_VALUE \c NULL \a path or \a linkToPath. 605 \retval B_ENTRY_NOT_FOUND \a path does not refer to a possible entry. 606 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 607 \retval B_NO_MEMORY Insufficient memory for operation. 608 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 609 \retval B_BUSY A node was busy. 610 \retval B_FILE_ERROR A general file error. 611 \retval B_FILE_EXISTS An entry with that name does already exist. 612 \retval B_NO_MORE_FDS The application has run out of file descriptors. 613 614 \since BeOS R3 615*/ 616 617 618/*! 619 \fn BDirectory& BDirectory::operator=(const BDirectory& dir) 620 \brief Assigns another BDirectory to this BDirectory. 621 622 If the passed in BDirectory object is uninitialized, the returned object 623 will be too. Otherwise it will refer to the same directory, unless an 624 error occurs. 625 626 \param dir The original BDirectory object. 627 628 \returns A reference to this BDirectory object. 629 630 \since BeOS R3 631*/ 632 633 634/*! 635 \fn int BDirectory::get_fd() const 636 \brief Returns the file descriptor of the BDirectory object. 637 638 This method should be used instead of accessing the private \c fDirFd 639 member directly. 640 641 \returns the file descriptor, or -1 if not properly initialized. 642 643 \since Haiku R1 644*/ 645 646 647/*! 648 \fn status_t create_directory(const char* path, mode_t mode) 649 \brief Creates all missing directories along a given path. 650 651 \param path The directory path name. 652 \param mode A permission specification, which shall be used for the 653 newly created directories. 654 655 \returns A status code. 656 \retval B_OK Everything went fine. 657 \retval B_BAD_VALUE \c NULL \a path. 658 \retval B_ENTRY_NOT_FOUND \a path does not refer to a possible entry. 659 \retval B_PERMISSION_DENIED Directory permissions didn't allow operation. 660 \retval B_NO_MEMORY Insufficient memory for operation. 661 \retval B_LINK_LIMIT Indicates a cyclic loop within the file system. 662 \retval B_BUSY A node was busy. 663 \retval B_FILE_ERROR A general file error. 664 \retval B_NOT_A_DIRECTORY An entry other than a directory with that name 665 already exists. 666 \retval B_NO_MORE_FDS The application has run out of file descriptors. 667 668 \since BeOS R3 669*/ 670