10-25-2001
Thanks
WOW!! Thanks a lot. That helps me out a lot.
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all
Is it possible to copy a structure of a directory only.
e.g.
I have a file with the following entries that is a result of a find :-
/dir1/dir2/file.dbf
/dir1/dir2/dir3/file1.dbf
/dir1/file.dbf
I want to copy these to a directory and keep the structure however starting at a new dir... (8 Replies)
Discussion started by: jhansrod
8 Replies
2. UNIX for Advanced & Expert Users
Hi,
I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies
3. Shell Programming and Scripting
I have writen the following code to show the dirctory structure. Can any body help me for using the recursive function in this code?
echo "-(0)"
echo "$HOME-(1)"
cd ~
set *
for i in `ls $HOME`
do
if
then
echo ".....${i}"
cd... (5 Replies)
Discussion started by: murtaza
5 Replies
4. Shell Programming and Scripting
Hi,
Has anyone tried to restrict Solaris 10 unix find on a large directory structure based on time to stop running after finding the first occurrence of a matching query. Basically I'm trying to build up a usage map of user workspaces based on file modification (week/month/3 months/year etc) and... (3 Replies)
Discussion started by: jm0221
3 Replies
5. UNIX for Dummies Questions & Answers
Hi...
I have a directory which has multiple directories and sub directories inside...
what command should i use to get a list of all these directories, without the filenames.... (2 Replies)
Discussion started by: saharookiedba
2 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I want to list all the last directories from mentioned base path.
for eg: If i have a base path say /base/base1/
How can i get the path till last node in tree like directory structure of unix by applying any command.
so that i will get following output.
... (7 Replies)
Discussion started by: Shiv@jad
7 Replies
7. UNIX for Dummies Questions & Answers
Hello Unix Gurus Who I Hope Reads This,
I have quasi-inherited control over a Linux cluster at a university research lab. The post-doc that set it up is gone, and the person in charge of administering the cluster doesn't know a ton about Linux. Amongst other things, I want to use the cluster... (0 Replies)
Discussion started by: mbl
0 Replies
8. Shell Programming and Scripting
Hey everyone
I am just trying print a directory structure but I am not getting the desired output.
I am using AIX.
Script :
input file contains : TNP\\ECOM\\test\\1
input_file=folders.txt
cat $input_file | while read line
do
echo $line
done (3 Replies)
Discussion started by: rocker_me2002
3 Replies
9. Shell Programming and Scripting
Hello ; ) again
Now I have my file like this :
DIR2/DIR3
DIR2
DIR2/DIR3/DIR4/DIR5
I am looking for help to create a loop that will create the directory structure.
I need something like this :
If "DIR2" does not exist > Create
IF "DIR2" exist already > check if onther "DIR"... (5 Replies)
Discussion started by: Aswex
5 Replies
LEARN ABOUT REDHAT
readdir
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)