dirent.h Questions
2
Solved
I am reading the source code of the dirent.h
there's a enum
enum
{
DT_UNKNOWN = 0, // unknown type
#define DT_UNKNOWN DT_UNKNOWN
DT_FIFO = 1, // a named pipe, or FIFO
#define DT_FIFO DT_FIFO
...
4
Solved
I am making a program which is run in a Linux shell, and accepts an argument (a directory), and displays all the files in the directory, along with their type.
Output should be like this:
<&l...
3
Solved
When we include <dirent.h> and <limits.h> to a c file, dirent structs' d_name variable shows We must not include limits.h! in the variable description in the ide. When I look at the fil...
5
Solved
I am using dirent.h 1.20 (source) for windows in VC2013.
I can't find mkdir() in it.
How am I supposed to use it? Or can I create a directory somehow only using dirent.h?
Jennajenne asked 2/5, 2014 at 12:7
6
Solved
How do i check in C++ if a file is a regular file (and is not a directory, a pipe, etc.)? I need a function isFile().
DIR *dp;
struct dirent *dirp;
while ((dirp = readdir(dp)) != NULL) {
if ( is...
Leid asked 30/11, 2008 at 15:18
1
Solved
I am trying to do a simple comparison to be able to do something if the file type read is a directory.
Sample code :
int main()
{
DIR *dir = opendir(".");
struct dirent *dirent = readdir(dir);...
2
I'm trying to get some old legacy code working on new 64-bit systems, and I'm currently stuck. Below is a small C file I'm using to test functionality that exists in the actual program that is curr...
3
Solved
in C++, what would be the best way to list all files of a directory on Windows?
On Linux or on Windows using gcc (e.g. MingW) this is easy possible with dirent.h, but what's the best way to do it ...
3
Solved
3
Solved
$ uname -a
Linux crowsnest 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 23:42:43 UTC 2011 x86_64 GNU/Linux
$ man readdir:
DESCRIPTION
The readdir() function returns a pointer to a dirent st...
1
Okay, so I'm using mingW, and the direct struct has no variables named d_type or stat, d_stat, or dd_stat. I need to know how I can use my direct struct to figure out if what I have is a file...
1
Solved
Currently I have some code like (condensed and removed a bunch of error checking):
dp = readdir(dir);
if (dp->d_type == DT_DIR) {
}
This works swimmingly on my Linux machine. However on anoth...
Flashcube asked 4/2, 2010 at 7:0
1
© 2022 - 2024 — McMap. All rights reserved.