Questions tagged [fstat]

38 questions
2
votes
2 answers

fstat - total file descriptor count on freebsd system?

How to get the current count of file descriptors in the system? I know how to get the maximum. % sysctl kern.maxfiles kern.maxfiles:…
Figo
  • 1,700
  • 3
  • 15
  • 24
1
vote
1 answer

fstat st_size says file size is 0 when unlinking file

Somewhere online I've seen a technique to immediately unlink a temporary file after opening it, since you will discard it anyway. As per my understanding of the man-page for unlink, the file will not be unlinked as long as it has an open file…
Markinson
  • 2,077
  • 4
  • 28
  • 56
1
vote
0 answers

Heteroskedasticity-robust F statistics in matlab

The F-stat from my standard model (multiple regression) is invalid since heteroskedacity is present. I have used The HAC function and computed the robust SE and new p-values, but how do I find the new robust F-stat? Is there a function in matlab to…
Sylteagurk
  • 11
  • 3
1
vote
0 answers

fstat64 in a strace and unfinished read

I have a small web app written in perl running mod_perl under apache. All it does is create a socket connection to a server and waits for an OK message before it sends a request. we only have max 10 children. At random times the reading of this Ok…
MArk W.
  • 21
  • 2
1
vote
1 answer

How to get file size given name and parent directory handle or inode?

I'm writing a little utility to scan through a directory tree recursively and record the tree structure with file names and sizes. (as fast as possible) Perhaps I've coded myself into a corner. I can get a directory's contents with readdir(3) and…
NoahR
  • 1,417
  • 3
  • 18
  • 33
1
vote
2 answers

fstat() return 0, with file size 0 and errno 11

I'm trying the following thing in my code:- { int y,n_bytes; struct stat temp_data; y = fstat(netdev->queue_fd[class_id],&temp_data); printf("Success - %d , size -> %lld , Error- %d \n",y,temp_data.st_size,errno); n_bytes =…
Sumit Paliwal
  • 385
  • 1
  • 3
  • 14
1
vote
2 answers

Printing info of a file/director (inode)

I want to print some information of a directory. My code is: #include #include #include #include #include #include #include #include #include int…
a_user
  • 207
  • 3
  • 13
1
vote
2 answers

How to get the number of process sharing a file by using mmap?

Is there any way to get the number of process those are mapped to a particular file ? Actually, I want to delete the file which is shared by multiple process when all processes are down. Is there any way to do that? I tried with fstat function call…
rajenpandit
  • 1,265
  • 1
  • 15
  • 21
1
vote
1 answer

Using fstat to determine file type

So, I have an assignment that basically is an exercise in comparing the speed of system calls opposed to library functions. We're sorting a string we grab from a file through stdin. We're supposed to determine if the file is a regular file or not…
T T
  • 261
  • 5
  • 16
0
votes
1 answer

stat function not returning proper result in st_size

I have a strange scenario where the stat function is providing the file size always as 4096. Below is the code snippet: #include #include using namespace std; int main() { struct stat st; cout << "stat call…
0
votes
3 answers

How can I find the dimension of the standard input?

I have a problem finding out how big is the dimension of the stdin through a pipe. I know that a lot of you will be furious at this question, but just hear me out. Half of it already works: $ echo "BYE" | ./my_prog In the linux shell outputs 4…
0
votes
3 answers

R "Could not find function <-<-" but I did not use that function

What I entered in the console (alp, DF1, DF2 are defined): LT <- left.tail=FALSE q <- qf(alp, DF1, DF2, LT) q What I got: LT <- left.tail=FALSE Error in LT <- left.tail = FALSE : could not find function "<-<-" > q <-…
0
votes
0 answers

how they are passing other arguments rather than st_buffer in fstat system call

I was given a assignment to run strace command on by hello world program and see the output, and I don't understand one thing in fstat system call. I got to know that fstat system call should have stat buff as second argument, but here we are…
Ellanti Kishore
  • 104
  • 1
  • 9
0
votes
1 answer

Difference between inode numbers of os.stat and os.fstat in python

I wanted to get file's inode in my windows machine, so first I tried os.stat('./filename.txt').st_ino in my REPL and the output I got was 0L. I tried the same for a couple of other files and got the same output. Then, I…
Pratik
  • 1,351
  • 1
  • 20
  • 37
0
votes
2 answers

How does PHP fstat() function work?

How does PHP fstat() function work? Does the function read file size from disk on every call? Or does the function calculate the size based on all writing operations performed? Example: $filename='abc.txt'; $fp=fopen($filename,…
Kinga the Witch
  • 129
  • 1
  • 5