Questions tagged [stat]

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

The stat(2) system call is used to retrieve information about a named file (or directory).

Links:

For statistics, use the tag instead.

829 questions
4
votes
6 answers

Inference about Slope coefficient in R

By default lm summary test slope coefficient equal to zero. My question is very basic. I want to know how to test slope coefficient equal to non-zero value. One approach could be to use confint but this does not provide p-value. I also wonder how to…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
4
votes
3 answers

What's the difference between struct __stat64 and struct _stati64 on WIN32?

I'm working on some code that needs to run on every version of windows since WIN2000 and also needs to work with wide file paths. I need to call some variant of stat to get the file length. The file may be larger than 4GB. Here's the relevant…
vy32
  • 28,461
  • 37
  • 122
  • 246
4
votes
1 answer

Path().stat().st_time timezone?

I am trying to get a file's last modified time using Python 3.8 in Cygwin. So if I do stat .profile I get: File: .profile Size: 1236 Blocks: 4 IO Block: 65536 regular file Device: 46e61a95h/1189485205d Inode:…
pepoluan
  • 6,132
  • 4
  • 46
  • 76
4
votes
1 answer

Why is performance of lstat poor on APFS (OSX) compared to Ext4 (Linux)

While profiling Git on a large repository, I found that git status is significantly (10x) slower on mac compared to linux. git status runs lstat on every file in the repository, which is where the slowness comes from. Is there a particular reason…
UtsavShah
  • 857
  • 1
  • 9
  • 20
4
votes
1 answer

perl File::Find and _

I am using File::Find to go through a ton of files and then doing cleanup based on their size, age etc. I am accessing these files through windows network shares so the stat calls are expensive The code looked something like this sub findItems { …
allmail
  • 133
  • 5
4
votes
1 answer

Getting uid and gid of a file

In linux the stat struct contains the UID and GID of a file. Is there a way to obtain the same information (UID and GID) of a file using Go(lang)?
Siscia
  • 1,421
  • 1
  • 12
  • 29
4
votes
3 answers

Get group ID (GID) of a file in Mac OS X via a shell command. What is the equivalent of stat -c "%g" 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.txt In every Linux I have tried, the above works…
user1942541
  • 297
  • 1
  • 3
  • 13
4
votes
0 answers

Pandas gives different results for different machines

When I upgraded from numpy 1.9 to 1.10 I started to see that the following regression model gives different results on different machines with the same hardware configuration: fitted_model = pd.ols(y=lhs_unpickled, x=rhs_unpickled,…
Darth.Vader
  • 5,079
  • 7
  • 50
  • 90
4
votes
2 answers

fs.statSync with Buffer "Error: Path must be a string without null bytes"

I have read in a file buffer like this: let imageBuffer try { imageBuffer = fs.readFileSync('/some/path/to/image.jpg') } catch (e) { console.log('error reading in file', e) } Then I try to stat the buffer: let imageStats =…
Jake Wilson
  • 88,616
  • 93
  • 252
  • 370
4
votes
1 answer

issue with using stat_summary to produce error bars for line graphs when faceting

I'm trying to add error bars to line graphs using stat_summary in ggplot2 but it won't work when I facet the graphs My data: date week year location imidacloprid block wickhami virescens sexta 1 15-May 1 2015 kinston tp 1 …
hortsystems
  • 75
  • 1
  • 7
4
votes
2 answers

unix permissions converter in symbolic notation (including sticky bit)

I need to get Access rights in more human readable format for file or folder with a symbolic notation like this u=rwx,g=srwx,o-rwx (possibly sticky bits) Using stat --format '%a', I obtain a result with format 2770, octal format Using stat --format…
Indent
  • 4,675
  • 1
  • 19
  • 35
4
votes
1 answer

How to get from '-rw-r--r--' back to 33188?

Python has a helper function stat.filemode to go from the st_mode (integer) as reported by os.stat into the familiar "stringy" format (I don't know if this representation has a proper name). >>> stat.filemode(0o100644) '-rw-r--r--' Is there any…
wim
  • 338,267
  • 99
  • 616
  • 750
4
votes
0 answers

Why does a 1-byte size file occupies 8 blocks in hard drive in ext4 filesystem?

I've ran into a scenario where I've created a simple plain text file with just one ASCII letter: a. I checked the file size with stat and here's what I got: $ stat file File: 'file' Size: 1 Blocks: 8 IO Block: 4096 regular…
GIZ
  • 4,409
  • 1
  • 24
  • 43
4
votes
4 answers

C++ - stat(), access() not working under gnu gcc

I've got a pretty basic console program here, to determine if a folder or file exists or not using stat: #include #include using namespace std; int main() { char path[] = "myfolder/"; struct stat status; …
Ben
  • 54,723
  • 49
  • 178
  • 224
4
votes
2 answers

How to get a files last changed time (Unix + Java)

In Unix there is a difference between last changed time and last modifies time. For example when using stat I can get: Access: 2016-01-18 10:50:01.624303144 +0100 Modify: 2016-01-12 13:34:18.274639073 +0100 Change: 2016-01-15 13:13:52.881401711…
Arenlind
  • 53
  • 5