Sponsored Content
Top Forums UNIX for Advanced & Expert Users need help in file traversal via FTS(3) Post 302245465 by jim mcnamara on Friday 10th of October 2008 07:15:52 AM
Old 10-10-2008
Just as an aside - ntfw() and ftw() are the POSIX (ie portable) functions for doing this kind of file tree walk. FTS has some neat features but it won't fly anywhere except linux.
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Command line traversal

What is a key, if on command line I have to trverse left & right word by word, instead of character by character? (7 Replies)
Discussion started by: videsh77
7 Replies

2. Shell Programming and Scripting

Creating breadth traversal binary tree

I almost have the entire script written. however the problem is how would i assign the global variable to terminate the process from the bottom up to ensure the child terminates so the parent can. ex. I am proccess 1 I am proccess 2 etc Here is the code $ cat tree.c ... (3 Replies)
Discussion started by: slurpeyatari
3 Replies

3. Shell Programming and Scripting

AWK File Traversal

Hey, I'm working on a file traversal and extraction function and am having problems. So, my script is finding all files in a directory. Each file has the same format. I need to extract a field from the 4th line of each file..... hence why I am using the substring on NR == 4. So, I am... (11 Replies)
Discussion started by: beefeater267
11 Replies

4. Shell Programming and Scripting

Match list of strings in File A and compare with File B, C and write to a output file in CSV format

Hi Friends, I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving... File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies

5. Shell Programming and Scripting

file traversal

Hi, I have to get some value of the from a flat file and my file format is like this. ABC DEF HIJ=1 XYZ xyz HIJ=2 So i need to make sure i get all the value of HIJ under XYZ and not ABC. (4 Replies)
Discussion started by: nidhink
4 Replies

6. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies

7. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
<ftw.h>(P)						     POSIX Programmer's Manual							<ftw.h>(P)

NAME
ftw.h - file tree traversal SYNOPSIS
#include <ftw.h> DESCRIPTION
The <ftw.h> header shall define the FTW structure that includes at least the following members: int base int level The <ftw.h> header shall define macros for use as values of the third argument to the application-supplied function that is passed as the second argument to ftw() and nftw(): FTW_F File. FTW_D Directory. FTW_DNR Directory without read permission. FTW_DP Directory with subdirectories visited. FTW_NS Unknown type; stat() failed. FTW_SL Symbolic link. FTW_SLN Symbolic link that names a nonexistent file. The <ftw.h> header shall define macros for use as values of the fourth argument to nftw(): FTW_PHYS Physical walk, does not follow symbolic links. Otherwise, nftw() follows links but does not walk down any path that crosses itself. FTW_MOUNT The walk does not cross a mount point. FTW_DEPTH All subdirectories are visited before the directory itself. FTW_CHDIR The walk changes to each directory before reading it. The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided. int ftw(const char *, int (*)(const char *, const struct stat *, int), int); int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW*), int, int); The <ftw.h> header shall define the stat structure and the symbolic names for st_mode and the file type test macros as described in <sys/stat.h> . Inclusion of the <ftw.h> header may also make visible all symbols from <sys/stat.h>. The following sections are informative. APPLICATION USAGE
None. RATIONALE
None. FUTURE DIRECTIONS
None. SEE ALSO
<sys/stat.h> , the System Interfaces volume of IEEE Std 1003.1-2001, ftw(), nftw() COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 <ftw.h>(P)
All times are GMT -4. The time now is 07:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy