10 More Discussions You Might Find Interesting
1. 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
2. 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
3. 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
4. Programming
hi all,
im using dirent.h headers readdir() function to traverse down a directory ( after openning it with opendir() ), and im printing the dir->d_name in a program.
while(( dir = readdir( d ) ) != NULL ){
if (stat(, &info) != 0){
fprintf(stderr, "stat() error on %s: %s\n",... (2 Replies)
Discussion started by: wolwy_pete
2 Replies
5. UNIX for Dummies Questions & Answers
Hi All
Please excuse another straightforward question. When creating a tar archive from a directory I am attempting to use wildcards to eliminate certain filetypes (otherwise the archive gets too large). So I am looking for something along these lines.
tar -cf archive.tar * <minus all *.rst... (5 Replies)
Discussion started by: C3000
5 Replies
6. 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
7. Shell Programming and Scripting
Hi,
I have a challenging task,in which i have to find the duplicate files by its name and size,then i need to take anyone of the file.Then i need to open the file and find for more than one pattern and count of that pattern.
Note:These are the samples of two files,but i can have more... (2 Replies)
Discussion started by: jerome Sukumar
2 Replies
8. UNIX for Dummies Questions & Answers
when writing a shell script (bourne) and using a unix command like 'ls' is there anything special you need to do to use a wildcard (like *)? (3 Replies)
Discussion started by: benu302000
3 Replies
9. 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
10. UNIX for Dummies Questions & Answers
I'm trying to delete lines from a large text file using VI.
Every line that I am wanting to delete start with 'S' - all others do not. (A list of users)
I've tried using * but doesn't seem to like it...any ideas...
Doesn't have to be VI - but I'm better with VI than sed/awk. (8 Replies)
Discussion started by: peter.herlihy
8 Replies