stat Questions

4

Just started learning Python. How can i get a status of file's attributes in Python? I know that os.chmod(fullname, stat.S_IWRITE) delete readonly attribute, but how can i get status without changi...
Grenier asked 28/11, 2014 at 21:29

3

Solved

What is the most idiomatic/efficient way to convert from a modification time retrieved from stat() call to a datetime object? I came up with the following (python3): from datetime import datetime,...
Trangtranquada asked 6/9, 2016 at 23:35

15

I'm trying to get multiple summary statistics in R/S-PLUS grouped by categorical column in one shot. I found couple of functions, but all of them do one statistic per call, like aggregate(). data &...
Fagaly asked 23/3, 2012 at 22:4

4

Solved

I am trying the following code: os.stat(path_name)[stat.ST_CTIME] = ctime However, this gives the following error: exceptions.TypeError: 'posix.stat_result' object does not support item assignm...
Took asked 27/4, 2011 at 12:2

4

Solved

What I am after is the meaning of such type and what interface can use it. It is explained in Posix spec that dev_t is used for device IDs. However, what device id means for any object described b...
Fluxmeter asked 9/3, 2012 at 14:30

2

Solved

i am coding a simple doc managing script and need to get the file size and file type /file or folder/ in a table. somehow it doesn't work into the mention directory. please help if possible: <...
Morelos asked 27/12, 2015 at 15:6

2

Solved

I am writing a program that finds all sub-directories from a parent directory which contains a huge number of files using os.File.Readdir, but running an strace to see the count of systemcalls show...
Konstanz asked 1/1, 2017 at 21:7

2

Solved

Is there an alternate way in perl6 to get file attribute details like size, access_time, modified_time.. etc. without having to invoke native call? As per the doc it is "unlikely to be implemented...
Civic asked 29/8, 2018 at 14:10

5

Solved

I analyzed my data using R package ‘stats’ (version 2.15.3). A reviewer asked me the right citation of this package and not only the common R Core Team (2012). R: A language and environment for st...
Argal asked 28/3, 2013 at 17:50

2

I need to find a way to flush the NFS attribute cache on the client side. stat() call reads ctime from attribute cache and not the actual value, takes upto 3 second for the actual value to be refle...
Spain asked 19/12, 2012 at 6:39

1

Solved

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 ...
Privacy asked 17/4, 2020 at 1:3

4

Solved

I have a lot of files in /home/somedir/subdir/ and I'm trying to move them all up to /home/somedir programmatically. right now I have this: subprocess.call(["mv", "/home/somedir/subdir/*", "somed...
Antarctica asked 15/2, 2014 at 23:9

4

Solved

I am wondering if its possible to list who all modified the file with course of time. I am aware that stat or ls -lrt will give the last user who modified the file. But I want to find out if it is ...
Character asked 2/9, 2015 at 9:8

1

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)?
Pandean asked 1/10, 2019 at 7:6

5

Solved

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 s...
Pallium asked 14/3, 2019 at 14:0

0

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...
Giffie asked 9/3, 2019 at 5:10

5

Solved

Is there a way to extract the values of the fitted line returned from stat_smooth? The code I am using looks like this: p <- ggplot(df1, aes(x=Days, y= Qty,group=Category,color=Category)) p &l...
Tiertza asked 20/3, 2012 at 15:35

3

It's my first time working with posix; I included: #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> And I've this snippet. stat(pathname, &sb); if ((sb.st_...
Phosphor asked 16/2, 2015 at 17:43

1

Solved

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> #incl...
Murmansk asked 17/12, 2018 at 7:59

2

Solved

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 erro...
Mainly asked 23/10, 2018 at 15:26

2

Solved

I am implementing the (ls) command on Unix while learning from a book. During the coding part of my implementation of the (ls) command with the (-l) flag, I see that I have to prompt the user and g...
Finecut asked 25/11, 2011 at 11:17

1

It seems a silly question, but I have searched on line, but still did not find any sufficient reply. My question is: suppose we have a matrix M, then we use the scale() function, how can we extrac...
Reasoned asked 8/7, 2018 at 5:47

6

Solved

With a find command, I can display directories names with multiple levels. The following command display all directories under /var path with a depth of 2: find /var -maxdepth 2 -type d; The res...
Sigler asked 2/1, 2014 at 22:21

3

Solved

For homework I have to write a C program and one of the things it has to do is check to see a file exists and if it is executable by the owner. Using (stat(path[j], &sb) >= 0 I'm able to se...
Halfwitted asked 27/10, 2012 at 8:50

2

Solved

I'm trying to write a function that tells me is a certain path is a directory. var fs = require('fs'); console.log("+++++++++++++++++++++++++++++++++++++++"); fs.statSync(pathname, function(err, s...
Lebbie asked 20/12, 2011 at 21:15

© 2022 - 2024 — McMap. All rights reserved.