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
0
votes
0 answers

Windows with mapped drive -- _stat() fails to detect existence of the file

Summary: The _stat() function says that there is not an existing file when the drive letter is mapped to UNC path. Details: On Windows system, there is the UNC path like \\computer\sharename\disk_M\the_subdir\file.txt and it is mapped this…
pepr
  • 20,112
  • 15
  • 76
  • 139
0
votes
2 answers

sys/stat.h returning wrong size

I am using unistd.h sys/stat.h and what is interesting is that st_size is bigger than the value returned after read()? st.st_size returns 644 - read() returns 606, Any thoughts?
Alex
  • 389
  • 1
  • 2
  • 14
0
votes
1 answer

Get the app last running time in android

I am trying to get the app last running time (not only my app) in android. From my understanding, all app is installed in /data/app/. So, I try to run stat command in adb shell to obtain the last access time of all apk. But it is surprising to me…
Bear
  • 5,138
  • 5
  • 50
  • 80
0
votes
1 answer

Report Rsquare and Standard Error SAS under PROC MODEL and SUR

If I run a simple proc reg in SAS, I have no problem to report the standard errors and rsquare. But why am I having some difficulties to report the Rsquare and Standard Errors for the intercepts and coefficients under this PROC MODELsetup? proc…
Plug4
  • 3,838
  • 9
  • 51
  • 79
0
votes
2 answers

Getting the DateModifed of a file using Stat() in Perl - Inappropriate I/O control operation

I'm attempting to read a file's datemodified value, but I've been unable to do so. I'm continually receiving "Inappropriate I/O control operation" errors. This is a windows directory structure that I'm attempting read. I've attempted to pass through…
etspaceman
  • 520
  • 5
  • 9
0
votes
1 answer

Ubuntu listing up files recursively, detecting sym-links

I'm trying to list up my local file-system recursively using dirent.h. In order to prevent from following sym-links, I'm using the sys/stat.h header. In the following you can find my SSCCE program. /** * coding: utf-8 * * Copyright (C) 2013,…
Niklas R
  • 16,299
  • 28
  • 108
  • 203
0
votes
1 answer

Path truncation issue with _wstat and Windows 7 share

This code: int main() { wchar_t fnucs2[260]; wcscpy(fnucs2, L"//buildserver7500/wec"); std::wcout << L" | wstat: " << fnucs2 << std::endl; struct _stat32i64 b; int r; r = _wstat32i64(fnucs2, &b); return…
Thomas
  • 3,348
  • 4
  • 35
  • 49
0
votes
1 answer

Comparing bz2 files in unix

I manage a number of databases on unix servers, and do daily backups of these databases using mysqldump. Since (some of) these databases are very large (20+Gb), I usually zip the backup .sql files using bzip2, to get compressed bz2 files. As part of…
amaidment
  • 6,942
  • 5
  • 52
  • 88
0
votes
2 answers

stat() not working for large filenames

I'm trying to write a program which reads a filename input from the user, stores it in 'name' and then later on will check if the filename entered is in the current directory. The problem I'm having is that when the user enters a filename of a file…
Sarah Wishart
  • 49
  • 1
  • 1
  • 2
0
votes
2 answers

Modified time using os.stat in Python gets lower when copying files

The issue I am running into is part of using os.stat on a path (Take C:\myfile1.txt for example). When I run os.stat on this file and take the 9th element in the resulting list I get the modified time in the form of some numbers (ex. 1348167977).…
Brad Conyers
  • 1,161
  • 4
  • 15
  • 24
0
votes
1 answer

stat returns ENOENT

I am running the following program, which checks if a file exists or not using stat(). But, when I am passing a path say, $HOME/file.sh, it fails with ENOENT error. But when I pass the expanded path i.e. /root/file.sh, stat() returns success i.e.…
trax_code
  • 19
  • 1
  • 4
0
votes
5 answers

Any specific reason why localtime throws warning with struct tm* & stat* , in linux ?

I have this simple code (part of a project) : void displayFileProperties(struct stat* file,char* outputProperties , char * path) { struct tm* time; // code // code time = localtime(&file->st_mtim); // code…
JAN
  • 21,236
  • 66
  • 181
  • 318
0
votes
3 answers

Store st_mode (from stat) in a file and reuse it in chmod

i'm going crazy for this. I'm trying to write an archive library which can store and extract files. An archive file looks like this: <0,/home/user/file.txt,154,0755> file contents (154 byte) Each file is identified by an header ( <...> ), with four…
Stephen Smally
  • 66
  • 1
  • 1
  • 6
0
votes
1 answer

How to get facebook ad statistics in utc

Is there a way to get ad statistics for a utc time, it seems like the returned stats are aligned to the ad account time zone. We tried to defined utc time zone for the ad account but we didn't found any country that match utc time (we assume that it…
Tal Cohen
  • 23
  • 5
0
votes
1 answer

filesize() [function.filesize]: stat failed for LinqBridge.dll in

i write a script to list my file from Update directory with this option: file-name file-hash file-size why i get this error: Warning: filesize() [function.filesize]: stat failed for LinqBridge.dll in C:\xampp\htdocs\update.php on line 15 my…
user1433591
  • 1
  • 1
  • 1
  • 5