Newest 'stat' Questions - Stack Overflow

Questions tagged [stat]

The stat(2) system call on POSIX systems. For statistics, use the statistics instead.

0
votes
0answers
18 views

Every time I try to install “meta” or “nloptr” packages, these errors pop up

Every time I try to install the "meta" package, errors pop up and it can't be installed. I'm using R studio from Anaconda on MacBook Pro macOS Mojave version 10.14.2 (18C54) : MacBook Pro (Retina, 15-...
0
votes
0answers
7 views

Get group ID (GID) of a file in Mac OS X via a shell command. What is the equivalent of stat -c “%g” <filename> for Mac OS X?

So, I want to quickly get the group ID (GID) of a file using the shell (more accurately, the GID of the owner of the file). Somewhere in my shell script, I have the following code: stat -c "%g" foo....
-1
votes
0answers
11 views

Website Error Log: Stat Error no such file or directory

getting this in my Error Log from Siteground: ERROR: stat /home/kitebud6/public_html/kitebud.com.auhttps:/kitebud.com.au: no such file or directory Trying to figure out what is calling this and how ...
0
votes
1answer
34 views

how to calculate total elapsed time

how to calculate elapsed time based on start time= [user001a@dev51 logs]# grep 'Recovery Manager' refresh_03Jun2019_0250.log|head -1|awk -F'on ' '{print $NF}'; Jun 3 02:50:02 2019 [user001a@dev51 ...
1
vote
1answer
68 views

How to count the files in a directory using C

The canonical way of determining a file's type is to use the commented out code in this snippet: // Return the number of files in dirName. Ignore directories and links. #include <sys/types.h> #...
0
votes
1answer
31 views

getting ValueError: Outputs of true_fn and false_fn must have the same type: int32, float32 while using tf.histogram_fixed_width_bins

Hope someone can help me with this or point me some hint/ideas I can fix this error. I am trying to create a custom layer in SeqtoSeq model.I need to call the histogram in part of my code. however, ...
0
votes
0answers
23 views

calculate differential entropy on specific distribution of the data

Sorry, I am a newbie in this. I want to calculate entropy on a distribution of the data in which they are continuous and they do not sum up to one. For example: x = [[1.01, 0.003, -0.8],[4.0, -1.8, ...
0
votes
0answers
37 views

How works python's stat module?

I know that a am little bit curious.Because i believe if i go deep , i can get it faster and in a short time i can be expert..Today Some things caught my eye in "stat" module in python 3.7 Sometimes ...
-1
votes
1answer
29 views

How to plot multiple lines in ggplot2 with years on x and frequecy on y

I have a data frame that looks like this TYPE YEAR ARSON 2008 THEFT 2009 ARSON 2010 ASSAULT 2008 The data ...
0
votes
0answers
13 views

How to group columns in r into rows by a second column [duplicate]

I am trying to manipulate this dataframe such that TYPE YEAR THEFT 2008 BATTERY 2010 THEFT 2009 THEFT 2008 ...
1
vote
1answer
28 views

Value Labels not updating Data in SPSS

I'm working with diagnostic questionnaire questions in SPSS to identify if an individual is depressed. I have imported the data from the survey and changed the the value labels to reflect the score ...
0
votes
0answers
26 views

Difference between constants defined in Go's syscall and C's stat.h [duplicate]

Hello stackoverflow friends, I am on arch linux. I was going over the constants defined in syscall package related to permission bits as a part of my internal project, and I see that the value of a ...
-2
votes
1answer
35 views

stat work at the command line but not when passed into a variable

I am debugging a bash script (on ubuntu) to obtain an image file block size using stat. The result from stat is correct at the command line but not when passed into a variable (as it is in the script)....
1
vote
0answers
42 views

How to properly use S_ISREG function

EDIT: After some help from the forum it was made clear that this issue was not in the use of S_ISREG() but in my use of lstat(). Sorry for the misleading question. I'm looking in a directory and ...
2
votes
0answers
85 views

What is “total” from ls -al?

I have been tasked to mimic the command ls -alU --time-style=long-iso. While i have it nearly down i don't quite understand what that first like of total is. I understand its the total amount of ...
0
votes
0answers
9 views

On NonDimentionalization for StackedBar

I would like to build StackedBar with a number of function m(X1, time), m(X2, time),...m(Xn, time) where each m(Xi, time) has its own unit. All different unit. To accomplish my task, I was thinking of ...
0
votes
1answer
14 views

fish: stat: Unable to find a process “Y”

I try to run the following command in Fish, without success: $ stat -c %Y foo fish: Unable to find a process “Y” However, in Bash, it works as expected: $ stat -c %Y foo 1548610349 I tried to put %...
0
votes
1answer
42 views

Invalid formula error in R - xtabs function giving environment issure

When trying to run this (or any other) command xtabs(ugdata$response, ugdata$Equity, data=ugdata) I keep receiving this error Error in formula.default(object, env = baseenv()) : invalid formula ...
0
votes
0answers
11 views

calculating NDCG of a query

How do you calculate NDCG_5? Specifically for the query below? I know DCG = r1 + r2/log_2(2) + r3/log_2(3) + … rn/log_2(n). Beyond this, I am confused.
13
votes
5answers
534 views

Why is stat::st_size 0 for devices but at the same time lseek defines the device size correctly?

I noticed that when I query the size of a device using open + lseek, everything is OK, but when I stat the device, I get zero instead of the real device size. The device is clean without any file ...
1
vote
0answers
25 views

In node.js how can I know whether fs.stat() will return usable `crtime` and/or `birthtime` fields for a given file/path/volume/fs?

I recently learned that different OSes and even different filesystems under the same OS support different subsets of the timestamps returned by lstat. The Stats object returned gives us four times, ...
0
votes
0answers
25 views

Getting size of subdirectories in C [duplicate]

I tried to get size of each directory under the root directory by using only root directory's path. I used lstat but it didn't work. I checked if path was right or not. lstat took right path but size ...
0
votes
0answers
10 views

Statistical Modelling

I really like watching films directed by the Coen brothers. Say that they make up about 40% of all the movies I watch. However, my wife Eve isn’t so enthusiastic. Suppose that we only watch Coen ...
0
votes
0answers
16 views

OSX: print both output and filename from command

I am trying to get the Last Modified time for each file in a directory, while also showing the filename next to the time. In Linux, it works great: $ find ./dumps/dump_scan_trial0_ds1/ -name '*pred*'...
1
vote
1answer
87 views

How's using FileAttributeKey.posixPermissions different from using stat -f %A?

I'm trying to get the posix permissions of a file, but when I use the key FileAttributeKey.posixPermissions (originally NSFilePosixPermissions) to retrieve the numerical posix permissions value, it ...
-1
votes
1answer
75 views

How can I get the stat in linux?

Im working in linux and C, and I am trying to get the specific values from stat. In /proc when I do stat I get multiple values returned. Now I'm trying to do this like below: thisFile = fopen("/proc/...
0
votes
0answers
20 views

How do I loop through arguments with a one instance of ProcessStart?

I am using following procedure to initiate a python instance to run a py file. public void ClassifyImages(string imagesString) { // https://medium.com/emoney-engineering/running-...
3
votes
1answer
101 views

How to change file permissions using os.chmod while preserving existing permissions?

I'm trying to selectively modify permissions for user, group, or others all at once, but whenever I use chmod, all permissions are overwritten. I've tried oring together current file permissions with ...
0
votes
1answer
36 views

Python3: Recursively compare two directories based on file contents

I have two directories containing a bunch of files and subfolders. I would like to check if the file contents are the same in both directories (ignoring the file name). The subfolder structure should ...
0
votes
0answers
83 views

GPU stats at container level

I am using https://hub.docker.com/r/jarkt/docker-remote-api/ to get Docker stats remotely using CURL as follows: curl http://<IP>:<PORT>/containers/<container_name>/stats . ...
3
votes
2answers
88 views

How to determine if two handles refer to the same file

I would like to check if two file handles refer to the same file. In order to do this, can I use the stat function applied to each file handle? Thanks in advance my $file = 'C:\temp\file.txt'); open( ...
2
votes
1answer
99 views

What is the meaning of each field with the output of `stat` on OSX?

$ stat Cargo.toml 16777220 9094681422 -rw-r--r-- 1 tonytonyjan staff 0 109 "Jan 19 10:05:13 2019" "Dec 31 17:52:29 2018" "Dec 31 17:52:29 2018" "Dec 14 16:32:26 2018" 4096 8 0 Cargo.toml man stat ...
0
votes
3answers
71 views

Iterate over directory and print some information

I want to write a C program that takes as an argument the path to a folder and shows some info about the files it contains. So far I have written this: #include <sys/types.h> #include <sys/...
0
votes
0answers
10 views

How to parse Webpack's stat errors object?

Is there no standard way to parse Webpack's stat errors object? Its just one long string that is so robust from error type to error type, I can't seem to come up with a proper way to consistently ...
1
vote
2answers
31 views

Get socket and pipe name in CentOS [closed]

Basically, I want to get socket and pipe owners starting from a PID located in the /proc/PID/fd/ directory using the "stat" command: lrwx------ 1 root root 64 dic 23 17:52 0 -> socket:[9790] l-wx--...
-3
votes
1answer
34 views

Question about common values across columns [closed]

I have a set of 20 column, each contains number value. I would like to have a function in excel or in r or somewhere else to extract the shared values among all the columns. Several of the online ...
0
votes
1answer
173 views

How to use statx syscall?

Ubuntu 18.04 I'm trying to use statx syscall introduced in the Linux Kernel 4.11. There is a manual entry: #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include ...
0
votes
0answers
40 views

Unix Stat command not working for a directory with 23 million files

What could be max inode count for stat command to work. We are going to partition the directory and we need to determine the limit so that stat command will work. PLease provide us the max count for ...
0
votes
0answers
21 views

Plotting an Exponential Best Fit Curve to ggplot2 using Stat_smooth [duplicate]

Here is my data: df <-read.table(text="x group y 1 A 0.5 2 A 0.25 3 A 0.1 1 B 0.6 2 B 0.7 3 B 0.2", header=TRUE) What I'm trying to do is plot ...
-6
votes
1answer
246 views

Using stat() to determine size for fread()

My file is not read to the end when using fread() and the size returned from stat() Manuals I'm checked: http://man7.org/linux/man-pages/man2/stat.2.html http://man7.org/linux/man-pages/...
0
votes
4answers
74 views

using awk and stat in one line to print values of stat

Below is the script which I'm trying to run. Cannot use stat inside awk. cat /etc/passwd | awk 'BEGIN{FS=":"}{print $6 }' | (stat $6 | sed -n '/^Access: (/{s/Access: (\([0-9]\+\).*$/\1/;p}' })' My ...
3
votes
0answers
40 views

Is Python's os.fstat available on every platform?

The documentation on os.stat() and os.fstat() is somewhat confusing about this. On os.stat() it says that on some platforms, it also accepts file descriptors and that the os.supports_fd set can be ...
0
votes
1answer
25 views

Monitor files added to directory for size (Bash)

I would like to monitor a directory and break another program if too small files are added. Here is my prototype: inotifywait -r -m -e modify . | while read _ _ file; do if (( $(stat --...
0
votes
0answers
114 views

stat() does not work for any other directory than parent “.” [duplicate]

I'm trying to write a simple "ls" script in C in bash (linux). I managed to write a script that gives me all information that I need about files in given directory, However, for some reason it works ...
-1
votes
2answers
125 views

Segmentation fault (core dumped) using stat (st_uid)

I would like to write a simple C script in UNIX that will work like "ls -l". I have a working part where the script lists all of the files in the current directory: #include <unistd.h> #include ...
0
votes
1answer
32 views

How to change month format for ls -l custom command

When you make this command : find ok/ -exec ls -l -d {} \; The terminal displays : drwxrwxrwx 2 alexia alexia 4096 8 oct. 15 22:31 ok/ I tried to make my own find command to do the same thing ...
4
votes
2answers
256 views

Using stat() after fopen() to Avoid TOCTOU Problems?

Title says it all: can one use stat() after fopen() to avoid Time of Check to Time of Use (TOCTOU) race conditions? Some details: I am writing a C program that only reads files, but needs to error ...
0
votes
0answers
31 views

Why do I can not get a corrected result of knn test in R?

After i enter all the code of the knn procedure and show the result as a table, the becomes data_test_target data_pred a b a 2289 131 b 0 0 sth like this. why ...
0
votes
0answers
16 views

How can I get statistics for fields which start with specific name in Solr stats component?

I get the simple statistics of the fields doing the following: q=*:* &stats=true &stats.field=myFieldName1 &stats.field=myFieldName2 &stats.field=myFieldName3 Is there a way to get ...
0
votes
0answers
19 views

Modification time of file is in the past compared to the time at which it was created

My code: import os from datetime import datetime now = str(datetime.now()) with open('now.txt', 'w') as f: f.write(now + '\n') print('now:', now) print() print('stat:') os.system('stat now.txt') ...