Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

closedir(3c) [opensolaris man page]

closedir(3C)						   Standard C Library Functions 					      closedir(3C)

NAME
closedir - close a directory stream SYNOPSIS
#include <sys/types.h> #include <dirent.h> int closedir(DIR *dirp); DESCRIPTION
The closedir() function closes the directory stream referred to by the argument dirp. Upon return, the value of dirp may no longer point to an accessible object of the type DIR. If a file descriptor is used to implement type DIR, that file descriptor will be closed. RETURN VALUES
Upon successful completion, closedir() returns 0. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The closedir() function may fail if: EBADF The dirp argument does not refer to an open directory stream. EINTR The closedir() function was interrupted by a signal. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
opendir(3C), attributes(5), standards(5) SunOS 5.11 24 Jul 2002 closedir(3C)

Check Out this Related Man Page

closedir(3C)						   Standard C Library Functions 					      closedir(3C)

NAME
closedir - close a directory stream SYNOPSIS
#include <sys/types.h> #include <dirent.h> int closedir(DIR *dirp); DESCRIPTION
The closedir() function closes the directory stream referred to by the argument dirp. Upon return, the value of dirp may no longer point to an accessible object of the type DIR. If a file descriptor is used to implement type DIR, that file descriptor will be closed. RETURN VALUES
Upon successful completion, closedir() returns 0. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The closedir() function may fail if: EBADF The dirp argument does not refer to an open directory stream. EINTR The closedir() function was interrupted by a signal. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
opendir(3C), attributes(5), standards(5) SunOS 5.10 24 Jul 2002 closedir(3C)
Man Page

11 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Copying Folder, C program

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Copying all the normal files from 1 folder to another on a unix platform. I pass in 1 or 2 arguments, the folder... (0 Replies)
Discussion started by: MW99
0 Replies

2. Shell Programming and Scripting

PERL script -- calling 'sed' by passing 'variable value'.

Hi Friends, I'm calling 'sed' command inside one perl script, which is to list directory names which are having some date value as their names (in the form YYYYMMDD) with in the range (start and end date). #!/usr/bin/perl -w use strict; use warnings; my $DATA = "/export/home/ganapa"; my... (5 Replies)
Discussion started by: ganapati
5 Replies

3. Programming

Program to search for a file on disk using c++

Hey guy, Is it possible to write a program in c++ to search for file in a particular drive? If so please provide the logic or the code Thanks :) (4 Replies)
Discussion started by: asamgosi
4 Replies

4. Shell Programming and Scripting

Sorting dates in Perl

I have a directory of backup files. named like this: ldap.data.04-06-2012.tar ldap.data.03-06-2012.tar ldap.data.02-06-2012.tar ldap.data.01-06-2012.tar ldap.data.31-05-2012.tar ldap.data.30-05-2012.tar ldap.data.29-05-2012.tar ldap.data.28-05-2012.tar ldap.data.27-05-2012.tar... (6 Replies)
Discussion started by: robsonde
6 Replies

5. Shell Programming and Scripting

PERL - Copying ONLY files from one dir to another

I'm writing a Perl script which has its 1st step as to copy files from one directory to another directory. The Source directory has got files with extension, without extension, directories etc. But I want to copy ONLY files with no extension. The files with extensions and directories should not get... (2 Replies)
Discussion started by: jhamaks
2 Replies

6. Shell Programming and Scripting

PERL - Use of uninitialized value in pattern match (m//)

I have written a PERL script to read files from directory that the filename contains OT. It then takes each line of each file and prints the first 5 characters before the first occurence of a /. Currently I am getting the error: Use of uninitialized value in string at rowGrab.pl line 43.... (3 Replies)
Discussion started by: chris01010
3 Replies

7. Shell Programming and Scripting

How to rename (move) most recent files in directory?

I'm using cygwin32 on Windows. DN is an environment variable pointed at my download directory. This command works to move the single most recent file in my download directory to my current directory: mv "`perl -e '$p = $ARGV; opendir $h, $p or die "cannot opendir $p: $!"; @f = sort { -M $a... (2 Replies)
Discussion started by: siegfried
2 Replies

8. Programming

Concatenating Struct Value With Char In C

After googling everything I could, the best I could do with this is get the following warning with -Wall: gcc -Wall help.c -o help help.c: In function ‘findpid': help.c:29:25: warning: passing argument 2 of ‘strncat' from incompatible pointer type strncat( pro, &str, 60); ... (5 Replies)
Discussion started by: Azrael
5 Replies

9. Shell Programming and Scripting

Insert Text after one, two, three lines & so on..

I want to insert "Text" in each file as a place where I mentioned below "Insert Text Here". These files are something like news of newspaper. Generally, newspaper headlines contain one or two lines. I don't know how it can be identified whether Text is inserted after first line or second line. ... (10 Replies)
Discussion started by: imranrasheedamu
10 Replies

10. Programming

Pipe usage error while visiting directories

To begin with FYI, I really struggled with the question before asking to simplify as much as I can around 1 hour and to increase the code's readability I neglect error checks. I intend to communicate parent and child using PIPE. In the following program I do traverse given path and its... (2 Replies)
Discussion started by: beginnerboy
2 Replies

11. Programming

Find Argv[i] in /bin and /sbin

Hello all, I am currently working on a package manager in C and am at the point where I am trying to check to see if the package is already installed. To do this I am taking the package name(s) as an argument using argv. The working code for doing this as follows: #include <stdio.h> #include... (5 Replies)
Discussion started by: realpath_issue
5 Replies