迭代目录的文件 [英] iterate over the files of a directory

查看:87
本文介绍了迭代目录的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须将程序从Windows移植到HPUX。它有一个算法

在名为_finddata_t的结构上使用_findfirst()和_findnext()迭代目录的文件及其所有子目录

。 />

在HPUX(aCC)或其他UNIX上有什么可能的替代品?

我只需要一个我能找到的功能名称。


谢谢。


TM

I have to port a program from Windows to HPUX. It has an algorithm
iterating over files of a directory and all of it''s subdirectories
using _findfirst() and _findnext() on a structure called _finddata_t.

What are possible replacements for this on HPUX (aCC) or other UNIXes?
I need just a function name I could look for.

Thank you.

T.M.

推荐答案

Torsten Mueller写道:
Torsten Mueller wrote:
我必须将程序从Windows移植到HPUX。它有一个算法在一个名为_finddata_t的结构上使用_findfirst()和_findnext()遍历目录及其所有子目录的文件。

什么是在HPUX(aCC)或其他UNIX上可能替换它?
我只需要一个我能找到的函数名。
I have to port a program from Windows to HPUX. It has an algorithm
iterating over files of a directory and all of it''s subdirectories
using _findfirst() and _findnext() on a structure called _finddata_t.

What are possible replacements for this on HPUX (aCC) or other UNIXes?
I need just a function name I could look for.




应该在像comp.unix.programmer这样的Un * x新闻组。

这里的主题是偏离主题的,因为clc ++只是关于ISO C ++。


无论如何,这就是答案:


man opendir

man readdir



That should have been asked in a Un*x newsgroup like comp.unix.programmer.
It''s off-topic here, since clc++ is only about ISO C++.

Anyway, here''s the answer:

man opendir
man readdir


2005-06-07,Rolf Magnus< ra ****** @ t-online.de>写道:
On 2005-06-07, Rolf Magnus <ra******@t-online.de> wrote:
Torsten Mueller写道:
Torsten Mueller wrote:
我必须将程序从Windows移植到HPUX。它有一个算法在一个名为_finddata_t的结构上使用_findfirst()和_findnext()遍历目录及其所有子目录的文件。

什么是在HPUX(aCC)或其他UNIX上可能替换它?
我只需要一个我能找到的函数名。
I have to port a program from Windows to HPUX. It has an algorithm
iterating over files of a directory and all of it''s subdirectories
using _findfirst() and _findnext() on a structure called _finddata_t.

What are possible replacements for this on HPUX (aCC) or other UNIXes?
I need just a function name I could look for.



应该在Un * x中提出这个问题。新闻组就像comp.unix.programmer。
这是偏离主题的,因为clc ++只是关于ISO C ++。

无论如何,这里是答案:

man opendir
man readdir



That should have been asked in a Un*x newsgroup like comp.unix.programmer.
It''s off-topic here, since clc++ is only about ISO C++.

Anyway, here''s the answer:

man opendir
man readdir




为了使它更具局部性( - ; ... IIRC,boost有一个类来做这个


干杯,

-

Donovan Rebbechi
http://pegasus.rutgers.edu/~elflord/


Torsten Mueller写道:
Torsten Mueller wrote:
我必须将程序从Windows移植到HPUX。它有一个算法在一个名为_finddata_t的结构上使用_findfirst()和_findnext()遍历目录及其所有子目录的文件。

有哪些可能的替代品为此在HPUX(aCC)或其他UNIX上?
我只需要一个我能找到的函数名。
I have to port a program from Windows to HPUX. It has an algorithm
iterating over files of a directory and all of it''s subdirectories
using _findfirst() and _findnext() on a structure called _finddata_t.

What are possible replacements for this on HPUX (aCC) or other UNIXes?
I need just a function name I could look for.




参见 http://www.boost.org/libs/filesystem/doc/index.htm 已将许多编译器/操作系统组合移植到



Jeff Flinn



See http://www.boost.org/libs/filesystem/doc/index.htm which has been ported
to many compiler/OS combinations.

Jeff Flinn


这篇关于迭代目录的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆