06-08-2008
Thankx fpmurphy for the reply, actually i had it given up until i saw ur answer recently. it worked, up to my requirement, thankx.
wolwy.
9 More Discussions You Might Find Interesting
1. Filesystems, Disks and Memory
I am trying to read the directory contents throgh the readdir system call.
After getting the directory entry I am testing the type of it by using the folllowing macros S_ISDIR() S_ISREG() etc. But in some systems every file in the directory is displaying like a sub directory. and in some systems... (2 Replies)
Discussion started by: gandhevinod
2 Replies
2. UNIX for Dummies Questions & Answers
I read the description of the command readdir by using 'man readdir'. However, in the description i was suggesed to refer to readdir(3).
I wonder how to see the manual of readdir(3)
Thanks (1 Reply)
Discussion started by: cy163
1 Replies
3. Programming
I am having a hard time doing this and can't seem to find an example to help me. This is my code:
DIR *dirp=opendir(pathname);
struct stat filebuf;
struct dirent entry;
struct dirent *dp=&entry;
RWCString pattern;
for (int i = 0; i < request_->getNumStreams(); i++)
{
... (2 Replies)
Discussion started by: ajgwin
2 Replies
4. Shell Programming and Scripting
I am trying to script and came up with a conclusion that I need a do while loop in my statement. I am stuck with the
do while syntax. I need to use it alongwith the if then else statement. Can I use it is a big question? I actually need to get all the files
that are there from within run_dt to... (1 Reply)
Discussion started by: aronmelon
1 Replies
5. Shell Programming and Scripting
Quick question.
I can not get the context corrert on this code.
opendir(DIR, ".");
@fileldiv = grep(/l*/,readdir(DIR));
closedir(DIR);
I am trying to search all html files within a dir that start with l.
Thanks for your help. (1 Reply)
Discussion started by: mrlayance
1 Replies
6. SuSE
Dear Experts,
i am trying to find whether the given name is file or a directory
dirp = opendir(dirname);
direntp = readdir(dirp);
if(direntp->d_type & DT_DIR)
{
printf("\n is a dirctory");
}
else
{
//dir_or_file = Mtrue;
printf("\n not a directory");
}
it always... (9 Replies)
Discussion started by: vin_pll
9 Replies
7. Programming
Hi everyone
I am developing an utility.
At some part of it I read directory entries to a dynamic array: struct list
It stores pointers to items: list.entries,
which are structures: struct entry
If a number of files in a directory is greater then number of elements an array was initially... (11 Replies)
Discussion started by: torbium
11 Replies
8. Shell Programming and Scripting
Hi all,
I have little working knowledge in unix shell scripting. I have a requirement where i need to pull out some data in between the strings in the file.
Input:
TEST
a
a
c
f
d
TEST
f
e
g
g
TEST
Output: (7 Replies)
Discussion started by: satyasrin82
7 Replies
9. Shell Programming and Scripting
Hi All,
I have a source file with data
Name ~ Groups
Muni~abc,was,USA_ax,123
Chaitanya~USA_12,was
Balaji~123,xyz,was
Ramu~123,xyz
From the second column i want to extract only the groups that matches the pattern 'USA_%' or if the group = 'was', and ignore any other columns.
... (8 Replies)
Discussion started by: morbid_angel
8 Replies
LEARN ABOUT SUNOS
dirent.h
dirent.h(3HEAD) Headers dirent.h(3HEAD)
NAME
dirent.h, dirent - format of directory entries
SYNOPSIS
#include <dirent.h>
DESCRIPTION
The internal format of directories is unspecified. The <dirent.h> header defines the following type:
DIR A type representing a directory stream.
The header also defines the structure dirent, which includes the following members:
ino_t d_ino /* file serial number */
char d_name[] /* name of entry */
The type ino_t is defined as described in <sys/types.h>. See types(3HEAD).
The character array d_name is of unspecified size, but the number of bytes preceding the terminating null byte must not exceed {NAME_MAX}.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO
closedir(3C), opendir(3C), readdir(3C), rewinddir(3C), seekdir(3C), telldir(3C), types.h(3HEAD), attributes(5), standards(5)
SunOS 5.10 10 Sep 2004 dirent.h(3HEAD)