g++: How do I access a list of all files in a folder?



 DEVELOP > c-Plus-Plus > g++: How do I access a list of all files in a folder?

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "Jacob Voytko"
Date: 01 Dec 2004 01:49:50 PM
Object: g++: How do I access a list of all files in a folder?
I am working with a group to write a program that organizes mp3 files
in a root folder based on tag criteria. The tag readers are written,
we are having trouble finding g++ documentation on reading all files
in a folder, and deciding which files are mp3's. Any help will be
appreciated.
.

User: "Jacek Dziedzic"

Title: Re: g++: How do I access a list of all files in a folder? 01 Dec 2004 04:13:10 PM
Jacob Voytko wrote:

I am working with a group to write a program that organizes mp3 files
in a root folder based on tag criteria. The tag readers are written,
we are having trouble finding g++ documentation on reading all files
in a folder, and deciding which files are mp3's. Any help will be
appreciated.

What's a folder? <g>
- J.
.

User: "Victor Bazarov"

Title: Re: g++: How do I access a list of all files in a folder? 01 Dec 2004 02:00:21 PM
Jacob Voytko wrote:

I am working with a group to write a program that organizes mp3 files
in a root folder based on tag criteria. The tag readers are written,
we are having trouble finding g++ documentation on reading all files
in a folder, and deciding which files are mp3's. Any help will be
appreciated.

news:gnu.g++.help
news:comp.os.<your_os_here>.*
V
.
User: "Jacob Voytko"

Title: Re: g++: How do I access a list of all files in a folder? 01 Dec 2004 06:26:24 PM
Gracias, seņor
.


User: "Thomas Ruschival"

Title: Re: g++: How do I access a list of all files in a folder? 01 Dec 2004 03:53:55 PM
just use the standard C function readdir()
the best thing about c++ is, you an use almost all th C-Libraries that have been developped ever since K&R invented C
Thomas
.
User: "Jerry Coffin"

Title: Re: g++: How do I access a list of all files in a folder? 01 Dec 2004 08:40:27 PM
Thomas Ruschival <t.ruschival@vivid-md.de> wrote in message news:<20041201225355.082fc7a5@Woody>...

just use the standard C function readdir()

While readdir is in a standard, it's in the POSIX standard, not the C
standard.

the best thing about c++ is, you an use almost all th C-Libraries that have
been developped ever since K&R invented C

C was invented and in wide use for a LONG time before readdir was
invented (before System V or so, directories also followed the UNIX
dictum that everything be treated as files -- a directory was just a
file full of structures of a specific type).
While Brian Kernighan helped write the original book on C, he did not,
by all accounts, help to invent the language -- if you were going to
give credit to anybody but Dennis Ritchie, possibilities might include
Ken Thompson (invented B, C's progenitor as well as the UNIX system to
which C was so closely bound, early on), Martin Richards (inventor of
BCPL, the progenitor of B) and/or Doug McIlroy (apparently invented
C's preprocessor, among many other things).
Though I wasn't present at the time, so my opinion should be taken
with a grain of salt, my own nomination in this category would
probably be Doug McIlroy -- reading books, papers, etc., it seems to
me like he influenced nearly every part of early UNIX and
(particularly) may have been one of the most careful about getting
things _right_ rather than "close enough."
--
Later,
Jerry.
The universe is a figment of its own imagination.
.
User: "Ron Natalie"

Title: Re: g++: How do I access a list of all files in a folder? 02 Dec 2004 09:13:14 AM
Jerry Coffin wrote:


C was invented and in wide use for a LONG time before readdir was
invented (before System V or so, directories also followed the UNIX
dictum that everything be treated as files -- a directory was just a
file full of structures of a specific type).

And it still is (actually, the more modern ones have variable length
things in it). Readdir just knows how to parse the directory file.
If I remember correctly, the original directories were just the
following:
struct {
unsigned short ino;
char name[14];
};
repeated.
When a file was removed, it just wrote zero to the ino member.
This led to an activity of artfully creating and deleting files
so that when you did something like:

cat /tmp
after some initial garbage for the files that were actually in use
there would appear a few new lines and some sort of ASCII-art picture.
.


User: "Victor Bazarov"

Title: Re: g++: How do I access a list of all files in a folder? 01 Dec 2004 03:59:04 PM
Thomas Ruschival wrote:

just use the standard C function readdir()

There no such standard C function. Perhaps you're considering the library
you have for programming your OS as standard. It isn't.

the best thing about c++ is, you an use almost all th C-Libraries that have been developped ever since K&R invented C

That's only true if you use an object-file compatible compiler.
V
.



  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER