In a program I am designing, I am using opendir() to test whether entries under a certain directory are sub-directories or not. This method works fine for the directory itself (.) and the parent directory (..), however it does not work for any sub-directories I manually create.
i.e. it does not work for current_directory/my_sub_directory
I am performing the test in the following manner
Is there anything I am failing to understand or am I missing out on anything ?
Hello!
I've moved a web from my RHEL5 Apache/2.2.3 machine to a Sun Solaris 5.9 Apache/2.2.6 (Unix) PHP/5.2.5 mod_ssl/2.2.6 machine.
The web worked just fine on the rhel5 machine and most of the php pages works fine on the solaris machine to but not the one where I read a directory and prints... (1 Reply)
Hello all,
Here's the deal...I have one directory with many subdirs and files.
What I want to find out is who is keeping old files and directories...say files and dirs that they didn't use since a number of n days, only one level under the initial dir. Output to a file.
A script for... (5 Replies)
greetings. I'm using debian lenny, bash shell environment.
It is my understanding that by default, the useradd command should create subdirectories under the /home directory, with the same name as the user being created, but this is not happening.
I checked useradd -D and it showed, among... (2 Replies)
Hello
I have some directories and files created under /export/local/user
I would like to delete directories only under /export/local/user, created before 3 days
Can someone help me with command to do this task?
Thanks (4 Replies)
Hi,
I have a challenging requiremant to be done in one day:(
there is directory in which a new directory gets created per hour i.e 24 directories per a day like below.
Dec 01 00:04 2011.12.12-23
Dec 01 01:11 2011.12.10-07
Dec 01 01:11 2011.12.10-08
Dec 01 01:11 2011.12.10-09
Dec 01... (2 Replies)
I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. This is for Solaris. Please help. (1 Reply)
Hi All,
I am new in scripting and working in a project where we have RSyslog servers over CentOS v7 and more than 200 network devices are sending logs to each RSyslog servers. For each network devices individual folders create on the name of the each network devices IP addresses.The main... (7 Replies)
Discussion started by: Pinaki
7 Replies
LEARN ABOUT REDHAT
opendir
OPENDIR(3) Linux Programmer's Manual OPENDIR(3)NAME
opendir - open a directory
SYNOPSIS
#include <sys/types.h>
#include <dirent.h>
DIR *opendir(const char *name);
DESCRIPTION
The opendir() function opens a directory stream corresponding to the directory name, and returns a pointer to the directory stream. The
stream is positioned at the first entry in the directory.
RETURN VALUE
The opendir() function returns a pointer to the directory stream or NULL if an error occurred.
ERRORS
EACCES Permission denied.
EMFILE Too many file descriptors in use by process.
ENFILE Too many files are currently open in the system.
ENOENT Directory does not exist, or name is an empty string.
ENOMEM Insufficient memory to complete the operation.
ENOTDIR
name is not a directory.
NOTES
The underlying file descriptor of the directory stream can be obtained using dirfd(3).
CONFORMING TO
SVID 3, POSIX, BSD 4.3
SEE ALSO open(2), closedir(3), dirfd(3), readdir(3), rewinddir(3), scandir(3), seekdir(3), telldir(3)
1995-06-11 OPENDIR(3)