stat Questions

3

Solved

I am trying to write a small C program that emulates the unix command ls -l. To do so, I am using the stat(2) syscall and have ran into a small hiccup writing the permissions. I have a mode_t var...
Crotchety asked 25/4, 2012 at 20:15

1

Solved

I want to be able to do a checksum based on a list of files in a local dir. Then be able to get those files checksum and compare it to the checksum of the same files on a remote system. I know I c...
Rifkin asked 18/4, 2017 at 20:21

3

Solved

Im writing a school assignment in C to search through a file system for directories, regular files and symlinks. For now i use lstat to get information about items. So whats the difference between...
Reimers asked 1/10, 2015 at 19:6

3

Solved

I have successfully used both stat() & access() separately to determine if a user has either read or read/write access to a directory. My question is: - Is there a preferred method ? I see a ...
Shrug asked 17/8, 2011 at 4:29

3

Solved

I'm porting over a large, old system that was known to work, onto Ubuntu 64-bit Linux. The system uses FLTK, upgrading to 1.3.2, and I'm using NetBeans. A file includes basic universal /FL/Fl.H as ...
Tingley asked 19/2, 2013 at 0:15

1

Solved

Converting some code to using asyncio, I'd like to give back control to the asyncio.BaseEventLoop as quickly as possible. This means to avoid blocking waits. Without asyncio I'd use os.stat() or p...
Sagittate asked 24/6, 2016 at 7:55

1

Solved

From Python: >>> import os >>> s = os.stat( '/etc/termcap') >>> print( oct(s.st_mode) ) **0o100444** When I check through Bash: $ stat -f "%p %N" /etc/termcap **12075...
Asparagus asked 7/4, 2016 at 20:7

3

I use opendir() to open a directory and then readdir() and lstat() to get the stats of each file in that directory. Following this manpage I wrote the code under which doesn't work as thought. It d...
Busch asked 6/10, 2011 at 12:33

1

Solved

Hello I require following information about process with some PID: name, ppid, state, #ofOpenFiles, #ofThreads I know the example of /proc/pid/stat file is like : 15 (watchdog/1) S 2 0 0 0 -1 ...
Shanklin asked 3/1, 2016 at 10:2

4

Solved

As a part of an assignment from one of my classes, I have to write a program in C to duplicate the results of the ls -al command. I have read up on the necessary materials but I am still not gettin...
Terenceterencio asked 25/11, 2012 at 18:39

1

I would have assumed that access() was just a wrapper around stat(), but I've been googling around and have found some anecdotes about replacing stat calls with 'cheaper' access calls. Assuming you...
Grussing asked 23/9, 2015 at 20:4

1

Solved

I have a dataframe with 1000 columns and 8 rows, I need to calculate row means.I tried this loop: final <- as.data.frame(matrix(nrow=8,ncol=1)) for(j in 1:8){ value<- mean(dataframe[j,]) f...
Pratt asked 27/5, 2015 at 0:41

1

Solved

I have a Database, and want to show a figure using stat_smooth. I can show the avg_time vs Scored_Probabilities figure, which looks like this: c <- ggplot(dataset1, aes(x=Avg.time, y=Scored.Pr...
Crosslink asked 13/5, 2015 at 7:44

3

Solved

In linux, when stat() is used with broken link files, it fails with -1. So I used lstat() which succeeded. For the same case in windows, _stat() fails with broken shortcuts, but there is no _lstat...
Pentyl asked 23/8, 2012 at 6:15

1

Solved

Summary: I want to get the generation number (i_generation) of a file in Linux (or at least ext4) from userspace. Or, alternatively, the 'birth time' (file creation time). I am trying to write a bi...
Marshland asked 18/11, 2013 at 16:35

2

Solved

I'm not able to identify the error thrown by stat. The below program reads all files in a directory and prints the file name: DIR *dp; struct dirent *dirp; struct stat sb; if((dp = opendir(argv[1...
Izzy asked 26/2, 2011 at 8:45

1

Solved

According to the man page for FileInfo, the following information is available when stat()ing a file in Go: type FileInfo interface { Name() string // base name of the file Size() int64 // lengt...
Spinner asked 10/11, 2014 at 23:31

1

Solved

I am trying to figure out how to apply a Python function to the oldest 50% of the sub-folders inside my parent directory. For instance, if I have 12 folders inside a directory called foo, I'd lik...
Levitation asked 19/5, 2014 at 13:16

5

Solved

If I have an open file with a known file descriptor, what are the advantages of using fstat(), versus stat()? Why isn't there only one function? int fstat(int fildes, struct stat *buf) int stat(c...
Elytron asked 19/4, 2014 at 11:9

4

I want to reproduce the output of ls --full-time from a Perl script to avoid the overhead of calling ls several thousand times. I was hoping to use the stat function and grab all the information fr...
Reconsider asked 18/3, 2010 at 14:16

3

Solved

Question: How do I efficiently use the stat function to get meaningful file permissions (User, Group and Other). Details: I am querying the file permissions like so: statInfo = os.stat permissi...
Audile asked 24/5, 2012 at 16:29

3

Solved

I'm trying to write a TCP server which a client can use to browse the server's directories. In addition to that I want to send the size of the directory if that is a regular file. The size of the f...
Anu asked 19/12, 2013 at 15:7

4

Solved

I am writing a simple C program that receives a directory as an argument and displays the files in this directory and also his subdirectories. I wrote a "recursive" function for doing that. But for...
Propman asked 19/9, 2011 at 23:31

1

Solved

Does Windows offer anything like POSIX stat's st_ctime field, which gives the timestamp of last metadata change? Background: I have some data files that I'd like to check if they've been modified ...
Largely asked 19/9, 2012 at 13:29

2

Solved

I have the following code: #!/bin/bash read -t1 < <(stat -t "/my/mountpoint") if [ $? -eq 1 ]; then echo NFS mount stale. Removing... umount -f -l /my/mountpoint fi How do I mute the o...
Seavey asked 19/7, 2013 at 16:56

© 2022 - 2024 — McMap. All rights reserved.