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...
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...
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...
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 ...
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...
1
Solved
4
Solved
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...
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...
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...
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...
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...
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...
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...
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...
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
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...
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.