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 ...
Fundus asked 30/10, 2012 at 4:33

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...
Oliguria asked 30/5, 2014 at 15:23

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...
Streeter asked 16/10, 2019 at 20:33

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);...
Glarum asked 11/10, 2017 at 17:35

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...
Topheavy asked 18/12, 2014 at 19:35

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 ...
Sinatra asked 30/4, 2011 at 8:35

3

Solved

I have started working with dirent.h library and I came across a very useful member of "struct dirent" structer which struct dirent *p->d_name in my book. But unfortunatly it doesn't states any oth...
Duncandunce asked 20/10, 2012 at 18:17

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...
Absa asked 23/8, 2011 at 9:23

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...
Moderation asked 2/10, 2010 at 5:48

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.