Sponsored Content
Top Forums UNIX for Advanced & Expert Users Directory with same names and different inode no Post 302692631 by guruprasadpr on Tuesday 28th of August 2012 02:34:42 AM
Old 08-28-2012
Hi

Code:
find . -inum 42734 -exec rm -rf '{}' \;

Guru.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Use of $ in directory names

I have a TAR (compressed) file that I uncompressed using the following command $ tar xvf uagent.tar It created a directory structure as follows <root>/arcagent/UAGENT/reloc/$UAGENT_HOME/ How do I access files under the $UAGENT_HOME? Every time I do change directory command, the OS... (3 Replies)
Discussion started by: pkappaz
3 Replies

2. Shell Programming and Scripting

Directory names that contain spaces and other suggestions?

The script below was written to select files and convert a particular string to something other and replace that file. However, I came across some issues with filenames that contain spaces, any suggestions to get around this? Any other suggestions that may apply to this code would also be... (5 Replies)
Discussion started by: Shakey21
5 Replies

3. UNIX for Dummies Questions & Answers

Directory Inode Number Not Unique

Hi, I know that inode for each file is unique, but is it the for the directory? So far I found different directories has the same inode nubmer when you do ls -i, could some one explain why? Thanks a lot. (9 Replies)
Discussion started by: nj302
9 Replies

4. Shell Programming and Scripting

How to sort directory names and use only last?

I need help writing a bash script for the windows cygwin environment. I'm not sure if bash is the optimal tool. Perhaps perl would be better? Either would work. I have directories whose names include the date they were created. The directory names are in the format of... (0 Replies)
Discussion started by: siegfried
0 Replies

5. Shell Programming and Scripting

Searching for file names in a directory while ignoring certain file names

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)
Discussion started by: 2reperry
2 Replies

6. UNIX for Dummies Questions & Answers

How to display only Owner and directory/sub directory names under particular root

hai, I am new to Unix, I have a requirement to display owner name , directory or sub directory name, who's owner name is not equal to "oasitqtc". (here "oasitqtc" is the owner of the directory or sub directory.) i have a command (below) which will display all folders and sub folders, but i... (6 Replies)
Discussion started by: gagan4599
6 Replies

7. UNIX for Dummies Questions & Answers

Loop through directory and extract sub directory names

I am trying to loop through folders and extract the name of the lowest level subfolder I was running the script below, it returns /bb/bin/prd/newyork /bb/bin/prd/london /bb/bin/prd/tokyo I really want newyork london tokyo I couldn't find a standard variable for the lowest level... (1 Reply)
Discussion started by: personalt
1 Replies

8. Shell Programming and Scripting

Grepping file names, comparing them to a directory of files, and moving them into a new directory

got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies

9. Shell Programming and Scripting

changing multiple directory names

Hi guys, I have lots of files that look like: ABC.packed.dir DEF.packed.dir GHI.packed.dir etc... I would like them to have more of the usual naming convention ABC DEF GHI etc... so I was thinking that I could: (2 Replies)
Discussion started by: atjurhs
2 Replies

10. UNIX for Dummies Questions & Answers

Loop through directory names

Some guidance is highly appreciated. I have 10 directories with names ending with 'xyz', each of them have about 30000 files. I want to loop through the contents of each directory and produce a single output per directory. So I want to have 10 output files named 'directory_name'_out. With... (1 Reply)
Discussion started by: newbie83
1 Replies
EIO_READDIR(3)								 1							    EIO_READDIR(3)

eio_readdir - Reads through a whole directory

SYNOPSIS
resource eio_readdir (string $path, int $flags, int $pri, callable $callback, [string $data = NULL]) DESCRIPTION
Reads through a whole directory(via the opendir, readdir and closedir system calls) and returns either the names or an array in $result argument of $callback function, depending on the $flags argument. PARAMETERS
o $path - Directory path. o $flags - Combination of EIO_READDIR_* constants. o $pri -The request priority: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX, or NULL. If NULL passed, $pri internally is set to EIO_PRI_DEFAULT. o $callback -$callback function is called when the request is done. It should match the following prototype: void callback(mixed $data, int $result[, resource $req]); o $data -is custom data passed to the request. o $result -request-specific result value; basically, the value returned by corresponding system call. o $req -is optional request resource which can be used with functions like eio_get_last_error(3) o $data - Arbitrary variable passed to $callback. RETURN VALUES
eio_readdir(3) returns request resource on success, or FALSE on error. Sets $result argument of $callback function according to $flags: o EIO_READDIR_DENTS ( integer) -eio_readdir(3) flag. If specified, the result argument of the callback becomes an array with the following keys: 'names' - array of directory names 'dents' - array of struct eio_dirent-like arrays having the following keys each: 'name' - the directory name; 'type' - one of EIO_DT_* constants; 'inode' - the inode number, if available, otherwise unspec- ified; o EIO_READDIR_DIRS_FIRST ( integer) - When this flag is specified, the names will be returned in an order where likely directories come first, in optimal stat order. o EIO_READDIR_STAT_ORDER ( integer) - When this flag is specified, then the names will be returned in an order suitable for stat'ing each one. When planning to stat(3) all files in the given directory, the returned order will likely be fastest. o EIO_READDIR_FOUND_UNKNOWN ( integer) - Node types: o EIO_DT_UNKNOWN ( integer) - Unknown node type(very common). Further stat(3) needed. o EIO_DT_FIFO ( integer) - FIFO node type o EIO_DT_CHR ( integer) - Node type o EIO_DT_MPC ( integer) - Multiplexed char device (v7+coherent) node type o EIO_DT_DIR ( integer) - Directory node type o EIO_DT_NAM ( integer) - Xenix special named file node type o EIO_DT_BLK ( integer) - Node type o EIO_DT_MPB ( integer) - Multiplexed block device (v7+coherent) o EIO_DT_REG ( integer) - Node type o EIO_DT_NWK ( integer) - o EIO_DT_CMP ( integer) - HP-UX network special node type o EIO_DT_LNK ( integer) - Link node type o EIO_DT_SOCK ( integer) - Socket node type o EIO_DT_DOOR ( integer) - Solaris door node type o EIO_DT_WHT ( integer) - Node type o EIO_DT_MAX ( integer) - Highest node type value EXAMPLES
Example #1 eio_readdir(3) example <?php /* Is called when eio_readdir() finishes */ function my_readdir_callback($data, $result) { echo __FUNCTION__, " called "; echo "data: "; var_dump($data); echo "result: "; var_dump($result); echo " "; } eio_readdir("/var/spool/news", EIO_READDIR_STAT_ORDER | EIO_READDIR_DIRS_FIRST, EIO_PRI_DEFAULT, "my_readdir_callback"); eio_event_loop(); ?> The above example will output something similar to: my_readdir_callback called data: NULL result: array(2) { ["names"]=> array(7) { [0]=> string(7) "archive" [1]=> string(8) "articles" [2]=> string(8) "incoming" [3]=> string(7) "innfeed" [4]=> string(8) "outgoing" [5]=> string(8) "overview" [6]=> string(3) "tmp" } ["dents"]=> array(7) { [0]=> array(3) { ["name"]=> string(7) "archive" ["type"]=> int(4) ["inode"]=> int(393265) } [1]=> array(3) { ["name"]=> string(8) "articles" ["type"]=> int(4) ["inode"]=> int(393266) } [2]=> array(3) { ["name"]=> string(8) "incoming" ["type"]=> int(4) ["inode"]=> int(393267) } [3]=> array(3) { ["name"]=> string(7) "innfeed" ["type"]=> int(4) ["inode"]=> int(393269) } [4]=> array(3) { ["name"]=> string(8) "outgoing" ["type"]=> int(4) ["inode"]=> int(393270) } [5]=> array(3) { ["name"]=> string(8) "overview" ["type"]=> int(4) ["inode"]=> int(393271) } [6]=> array(3) { ["name"]=> string(3) "tmp" ["type"]=> int(4) ["inode"]=> int(393272) } } } PHP Documentation Group EIO_READDIR(3)
All times are GMT -4. The time now is 05:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy