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
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...
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...
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:
<...
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...
2
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 ...
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
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)?
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...
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...
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_...
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...
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...
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...
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...
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...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.