08-19-2008
As an aside, some kernels - BSD is one - have an fhopen call that will open a file based on inode number.
I don't see how that helps since you can read the file via /proc/<pid>/fd. If the filesystem still has the data out there somewhere, can you read the file onto media to rescue it?
10 More Discussions You Might Find Interesting
1. Filesystems, Disks and Memory
as kernel keeps track of user activities on a file by its INODE number and I node table .
what is the structure of Inode table. and where does this Inode table mapped into?user space or kernel space?
is the Inode Number is fixed for a file till its deletion?
thanks (1 Reply)
Discussion started by: compbug
1 Replies
2. Solaris
I'm trying to relink a file someone tried to delete while a process (that we don't want to shutdown) also had a filehandle open to it.
Consequently, we've got an inode entry but no directory entry (aka 'file') for it.
I've tracked the inode number down via lsof, as well as the particular... (0 Replies)
Discussion started by: Smiling Dragon
0 Replies
3. UNIX for Dummies Questions & Answers
How we can know number of inode present in my Disk including free and occupied.
Is there any tool or program to know how much free inode are there in inode free list . (2 Replies)
Discussion started by: mr_deb
2 Replies
4. Solaris
Folks,
just wondering if there is a way to recreate this file if inadvertantly removed ?? (8 Replies)
Discussion started by: trevagreene
8 Replies
5. AIX
How to get the filename of which has been deleted if I know the inode number.
i can use the command "istat" to get the inode number of the file.
# istat
/proc//fd/x
If this file has been deleted,but the process of this file has not been closed and handle has not been released ,so this... (3 Replies)
Discussion started by: JoyOnLine
3 Replies
6. Shell Programming and Scripting
Hi all,
I am struggling to change the content of a file without changing the inode number. The exact issue is as below.
I have a file name test.bak which has 100 lines of text.
I am trying to to delete the first 90 lines of the text in the file.
I know that using sed/awk/head/tail I can... (3 Replies)
Discussion started by: sathishkmrv
3 Replies
7. Red Hat
Hi,
I have created a file abc.log in Redhat Linux.
Inode number for a file get changes every time i update the file using vi editor.
Is there any setting that can be made , such that inode number never gets changed?
Or if we cannot restrict from inode number getting changed , is... (9 Replies)
Discussion started by: raghu.amilineni
9 Replies
8. Solaris
Some one please help me to find deleted file name, if I am having inode number in Solaris without using any 3rd party tool.
Thanks :) (3 Replies)
Discussion started by: aksijain
3 Replies
9. Shell Programming and Scripting
is it possible to change the inode value/ file path of a hard link? (2 Replies)
Discussion started by: fhill2
2 Replies
10. Linux
Hi,
I have created a file a.txt in Redhat Linux.
Inode number for a file changes every time i update the file using vi editor , gedit etc.
Is there any setting that can be made , such that inode number never changes as that is supposed to be the expected behavior?
Or if we cannot... (13 Replies)
Discussion started by: srirammanohar
13 Replies
LEARN ABOUT FREEBSD
fhopen
FHOPEN(2) BSD System Calls Manual FHOPEN(2)
NAME
fhopen, fhstat, fhstatfs -- access file via file handle
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/stat.h>
int
fhopen(const fhandle_t *fhp, int flags);
int
fhstat(const fhandle_t *fhp, struct stat *sb);
int
fhstatfs(const fhandle_t *fhp, struct statfs *buf);
DESCRIPTION
These system calls provide a means to access a file given the file handle fhp. As this method bypasses directory access restrictions, these
calls are restricted to the superuser.
The fhopen() system call opens the file referenced by fhp for reading and/or writing as specified by the argument flags and returns the file
descriptor to the calling process. The flags argument is specified by or'ing together the flags used for the open(2) system call. All said
flags are valid except for O_CREAT.
The fhstat() and fhstatfs() system calls provide the functionality of the fstat(2) and fstatfs(2) calls except that they return information
for the file referred to by fhp rather than an open file.
RETURN VALUES
Upon successful completion, fhopen() returns the file descriptor for the opened file; otherwise the value -1 is returned and the global vari-
able errno is set to indicate the error.
The fhstat() and fhstatfs() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable errno is
set to indicate the error.
ERRORS
In addition to the errors returned by open(2), fstat(2), and fstatfs(2) respectively, fhopen(), fhstat(), and fhstatfs() will return
[EINVAL] Calling fhopen() with O_CREAT set.
[ESTALE] The file handle fhp is no longer valid.
SEE ALSO
fstat(2), fstatfs(2), getfh(2), open(2)
HISTORY
The fhopen(), fhstat(), and fhstatfs() system calls first appeared in NetBSD 1.5 and were adapted to FreeBSD 4.0 by Alfred Perlstein.
AUTHORS
This manual page was written by William Studenmund for NetBSD.
BSD
June 29, 1999 BSD