Something very weird has been happening when I'm creating files and directories. When I create a directory, at times depending on the directory name and depth, it becomes hidden and can only be seen typing "ls -a". When I say the name of the directory matters, "my_c++" will be hidden but using... (10 Replies)
Hi,
Consider a flat file abc.conf contains some rows. Each row contains the directory name with full path. now I want to find a particular file in every directory which are mentioned in the abc.conf file. How it can be done through unix shell script. (2 Replies)
Hi,
I am unable to see all files in a current directory when use "ls -lrt" command
it is giving error message as below ( I think this current directory is having about 500 files)
<CONTROL /home/ckanth/sri>ls -lrt
UX:ls: ERROR: Out of memory: Insufficient or invalid memory
But when i... (3 Replies)
Hi All
I was wondering what is the most efficient way to find files in the current directory(that may contain 100,000's files), that meets a certain specified file type and of a certain age.
I have experimented with the find command in unix but it also searches all sub directories. I have... (2 Replies)
Sun Solaris Unix Question
Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
I would need a command for finding first 15000 of the file names whose 25th postion is 5 in the current directory alone.
I do have this painful command
find . -name '5*' | head -15000 | cut -c3-
please refine this.
Of course the above command also searches in the sub directories... (3 Replies)
I have text file in Linux with two rows : first row conmtain the column nam and the second row contain its value .I nned to fetch few columns first and then redirect the data of those colum in the another file.
Any ideas?? (1 Reply)
Hi All,
Can any one help me to list out the directory names which contain the specified file.
See for example
File name : file.201307014.LKT
Have the directory structure as below.
/app/work/data/INDIA/file.201307014.LKT
/app/work/data/AMERICA/file.201307014.KTP... (5 Replies)
Can someone give me a tip on writing a script that, for each file in the working directory, prints the filename, the # of lines, and the # of words to stdout? (2 Replies)
Discussion started by: flash123
2 Replies
LEARN ABOUT MINIX
director
DIRECTORY(3) Library Functions Manual DIRECTORY(3)NAME
directory, opendir, readdir, rewinddir, closedir, telldir, seekdir - directory routines
SYNOPSIS
#include <sys/types.h>
#include <dirent.h>
DIR *opendir(const char *dirname)
struct dirent *readdir(DIR *dirp)
void rewinddir(DIR *dirp)
int closedir(DIR *dirp)
#define _MINIX 1
#include <sys/types.h>
#include <dirent.h>
long telldir(DIR *dirp)
int seekdir(DIR *dirp, long pos)
DESCRIPTION
These routines form a system independent interface to access directories.
Opendir() opens the directory dirname and returns a pointer to this open directory stream.
Readdir() reads one entry from the directory as a pointer to a structure containing the field d_name, a character array containing the
null-terminated name of the entry.
Rewinddir() allows the directory to be read again from the beginning.
Closedir() closes the directory and releases administrative data.
The Minix specific functions telldir() and seekdir() allow one to get the current position in the directory file and to return there later.
Seekdir() may only be called with a position returned by telldir() or 0 (rewind). These functions should not be used in portable programs.
SEE ALSO dir(5).
DIAGNOSTICS
Opendir() returns a null pointer if dirname can't be opened, or if it can't allocate enough memory for the DIR structure.
Readdir() returns null if there are no more directory entries or on error.
Closedir() and seekdir() returns 0 on success, -1 on error.
Telldir() returns -1 on error.
All of them set errno appropriately. Readdir() will only set errno on error, not on end-of-dir, so you should set errno to zero before-
hand, and check its value if readdir() returns null.
NOTES
The return value of readdir() needs to be copied before the next operation on the same directory if it is to be saved.
AUTHOR
Kees J. Bot (kjb@cs.vu.nl)
DIRECTORY(3)