Sponsored Content
Full Discussion: stream output??
Top Forums Programming stream output?? Post 8683 by solvman on Tuesday 16th of October 2001 01:26:16 PM
Old 10-16-2001
stream output??

Hi all,

I've a structure let's say
typdef struct a { int a; int b; char* string} b;

I need to make the function smth like readdir(), returning everytime it's called pointer to the next structure. Let's say functions would read the next file in the directory and all the permitions put it in a structure and returns it. When it's called next time it moves to the next files, etc. (It's just an example, so you would understand my task easier). How do i make that kinda STREAM output??

Thank you all,
Regards
Smilie
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Stream MP3s

What is a good and easy to set up program on Unix FreeBSD for playing streaming MP3s. Where can I get it and how do I install it? This is FreeBSD 4.3. Thanx. (2 Replies)
Discussion started by: ByondF1
2 Replies

2. Programming

File I/O Stream

Hi All, I am trying to read data from two files and then compare them and only print the records on the screen that have a same ID.i.e TAGNO =CUSTOMERNO For Eg My Input Files are (a) Transaction (b) Customer detail The data in file a is like: TagNo Date Time Station... (0 Replies)
Discussion started by: rooh
0 Replies

3. UNIX for Advanced & Expert Users

the stream edditor

:D i have searched through several sites on google for a match up for sed that would go indepth into the workings of this interactive edditor.. I use it every day and it is the edditor of my choice so i know a few tricks but would very much like to get into the more complex uses of sed.. all the... (2 Replies)
Discussion started by: moxxx68
2 Replies

4. UNIX for Dummies Questions & Answers

how can I use the stream output in other program

Hello I wander if im doing : ls -l and its giving me lets say 3 results : -rw-r--r-- 1 blah other 1789 May 19 2003 foo.c -rw-r--r-- 1 blah other 1014 May 19 2003 foo.h -rw-r--r-- 1 blah other 270 May 19 2003 foo1.c now I would like to use the first... (1 Reply)
Discussion started by: umen
1 Replies

5. UNIX for Dummies Questions & Answers

Interpreting java output stream as system commands in Solaris

Hi there again, Running Solaris 10 with built-in Java. Seems to compile and run fine. Problem is: Say I want to see contents of current directory. In a shell, I'd just write "ls" and it outputs the content. When I write a Java file, I have the following line: System.out.println("ls"); ... (1 Reply)
Discussion started by: EugeneG
1 Replies

6. Ubuntu

Stream video

Hello, I have Ubuntu 64 bit 9.04 install dual boot I can't see stream videos through Opera I couldnt see it in Firefox did this: "sudo apt-get install ubuntu-restricted-extras flashplugin-nonfree" Now I can see it in firefox but not in Opera Should not care and just use just Firefox. thanks (0 Replies)
Discussion started by: Pitroadrush
0 Replies

7. UNIX for Dummies Questions & Answers

Get the last value in the input stream

Hello Everyone, The situation is: $ alias rm="sh abc.sh" #abc.sh: read input echo "The input was: " $input $ rm xyz.txt should return "The input was: xyz.txt" Here, I want the alias "rm" to execute the file "abc.sh", where "abc.sh" should take "xyz.txt"... (1 Reply)
Discussion started by: qasim
1 Replies

8. Shell Programming and Scripting

[Video stream] network stream recording with mplayer

Hi I used this command: mplayer http://host/axis-cgi/mjpg/video.cgi -user root -passwd root \ -cache 1024 -fps 25.0 -nosound -vc ffh264 \ -demuxer 3 -dumpstream -dumpfile output.avi It's ok but... Video Playing is very fast! Why? Is it a synch problem? What parameter I have to use for... (1 Reply)
Discussion started by: takeo.kikuta
1 Replies

9. Shell Programming and Scripting

Count lines and words of a stream output with tail

Hello, I need to tail -f a file output stream and I need to get only lines that contains "get" and "point" in the same line. It doesn't matter the order. Then I need only the text BEFORE "point". I have to count each line and perform other serveral actions after this has performed 3 times.... (9 Replies)
Discussion started by: Kibou
9 Replies
READDIR(2)						     Linux Programmer's Manual							READDIR(2)

NAME
readdir - read directory entry SYNOPSIS
int readdir(unsigned int fd, struct old_linux_dirent *dirp, unsigned int count); Note: There is no glibc wrapper for this system call; see NOTES. 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 is superseded by getdents(2). readdir() reads one old_linux_dirent structure from the directory referred to by the file descriptor fd into the buffer pointed to by dirp. The argument count is ignored; at most one old_linux_dirent structure is read. The old_linux_dirent structure is declared as follows: struct old_linux_dirent { long d_ino; /* inode number */ off_t d_off; /* offset to this old_linux_dirent */ unsigned short d_reclen; /* length of this d_name */ char d_name[NAME_MAX+1]; /* filename (null-terminated) */ } d_ino is an inode number. d_off is the distance from the start of the directory to this old_linux_dirent. d_reclen is the size of d_name, not counting the terminating null byte. d_name is a null-terminated filename. 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. NOTES
Glibc does not provide a wrapper for this system call; call it using syscall(2). You will need to define the old_linux_dirent structure yourself. However, probably you should use readdir(3) instead. SEE ALSO
getdents(2), readdir(3) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2012-07-13 READDIR(2)
All times are GMT -4. The time now is 10:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy