Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Reg getdents command in linux Post 70369 by deep on Thursday 28th of April 2005 08:20:58 AM
Old 04-28-2005
Reg getdents command in linux

Hi frnds,
i need ur help reg getdents command which is used to read the directory entries. I need to know the exact usage of the command and any sample code reg the usage of getdents command

-------------
deep Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SCO vs Linux Reg Expressions Problem

Hi there, I'm investigating migrating a system currently running Scos osr5 to Linux (eg RH 7.2) but there are a lot of in house scripts, some of which are probably using "Sco specific" constructs etc. One I have come across is as follows, if ????? ] then ....etc.etc fi The regular... (2 Replies)
Discussion started by: pcs7088
2 Replies

2. Shell Programming and Scripting

Command param subst to reg expression

I want to find out Row which starts with, the user specified details to a script. In general I know what command to be given. awk '$0~/^Vi/' BReject But I need to pass on $1 param of command line at the place of 'Vi'. I tried with -v subst=$1 awk -v subst=$1 '$0~/^subst/' BReject But it... (5 Replies)
Discussion started by: videsh77
5 Replies

3. UNIX for Dummies Questions & Answers

reg script command....

hi frnds, i need all ur help guys.. I am facing problem when i give script < file name> command whenever i give this command,i get an error message indicating "Openpty failed. Terminated" :confused: can u help me out... with regds, Deep (7 Replies)
Discussion started by: deep
7 Replies

4. Shell Programming and Scripting

reg Mailx command or masking of mailid

I am using the mailx command of Unix through which I am able send mails but the problem is the from mail ID is automatically buit by unix as the (UNIX Box Name:---------------------------------) to mask the from id the option used by mailx is -r but for some security reasons this is blocked by the... (1 Reply)
Discussion started by: naren_chella
1 Replies

5. Solaris

small doubt reg uname command

Am new to solaris can anyone explain the fields in the below command. Also let me know the difference between nodename and hostname. Here osnask2 is the hostname and type SUNOS. What abt the remaining fields.? #uname -a SunOS osnska2 5.8 Generic_117350-47 sun4u sparc SUNW,Sun-Fire-480R (1 Reply)
Discussion started by: rogerben
1 Replies

6. Linux

Reg. RAID in linux

Hi Guys, I had a small task to install linux using Kickstart(Remote Installation) in sun x4450 server. Any document with screen shot for linux installation. please assist me, Thanks in Advance. specifications 2* Quad core 2.93 ghz cpu 32 gb 4 * 146 gb harddisk (1 Reply)
Discussion started by: kurva
1 Replies

7. Solaris

doubt reg prstat command

Hi, Can anyone explain me what is RSS time in the prstat output. In the below example 93M is total process size(correct me if am wrong ) what abt 58M? 1693 root 93M 58M cpu1 0 10 4:11:02 0.8% java/35 (2 Replies)
Discussion started by: rogerben
2 Replies

8. Solaris

doubt reg mailx command

Hi, Am trying to send mail from solaris host to my mailbox, but while executing mailx command am getting the follow error.Is this syntax corect? #mailx -s "subject" <myid> The flags you gave are used only when sending mail. (1 Reply)
Discussion started by: rogerben
1 Replies

9. Shell Programming and Scripting

Reg using sendmail for mail with attachment in Linux

Hi, Can anyone point out some examples on how to use sendmail to send mails with attachments. We have a requirement to change from address and so we are not able to use uuencode along with mailx for sending emails. All your reponses are highly appreciated. Thanks, Manick. (3 Replies)
Discussion started by: manickaraja
3 Replies

10. Shell Programming and Scripting

Going mad on an egrep command (Reg Expressions)

Dear community, I am trying for several hours now to create an egrep command to grep the number of lines containing a specific text from a text-file but seem to have an error somewhere. The Textfile contains several thousand lines and has the expression "Lastname" in several lines.... (3 Replies)
Discussion started by: Donzo
3 Replies
READDIR(2)						     Linux Programmer's Manual							READDIR(2)

NAME
readdir - read directory entry SYNOPSIS
#include <unistd.h> #include <linux/dirent.h> #include <linux/unistd.h> _syscall3(int, readdir, uint, fd, struct dirent *, dirp, uint, count); int readdir(unsigned int fd, struct dirent *dirp, unsigned int count); DESCRIPTION
This is not the function you are interested in. Look at readdir(3) for the POSIX conforming C library interface. This page documents the bare kernel system call interface, which can change, and which is superseded by getdents(2). readdir reads one dirent structure from the directory pointed at by fd into the memory area pointed to by dirp. The parameter count is ignored; at most one dirent structure is read. The dirent structure is declared as follows: struct dirent { long d_ino; /* inode number */ off_t d_off; /* offset to this dirent */ unsigned short d_reclen; /* length of this d_name */ char d_name [NAME_MAX+1]; /* file name (null-terminated) */ } d_ino is an inode number. d_off is the distance from the start of the directory to this dirent. d_reclen is the size of d_name, not counting the null terminator. d_name is a null-terminated file name. RETURN VALUE
On success, 1 is returned. On end of directory, 0 is returned. On error, -1 is returned, and errno is set appropriately. ERRORS
EBADF Invalid file descriptor fd. EFAULT Argument points outside the calling process's address space. EINVAL Result buffer is too small. ENOENT No such directory. ENOTDIR File descriptor does not refer to a directory. CONFORMING TO
This system call is Linux specific. SEE ALSO
getdents(2), readdir(3) Linux 1.3.6 1995-07-22 READDIR(2)
All times are GMT -4. The time now is 08:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy