linux中的文件系统 [英] File system in linux

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

问题描述




如何获取当前目录的文件列表或C>
函数中的目录?

和如何更改C中的当前目录?


谢谢,

Daniel

Hi,

how to get the file list of current directory or a directory in C
functions?
and how do I change current dir in C?

Thanks,
Daniel

推荐答案

da************@gmail.com écrit:
如何获取当前目录的文件列表或C
函数中的目录?


没有标准方式。最便携的是POSIX方式:

opendir(),readdir()等

以及如何更改C中的当前目录?
how to get the file list of current directory or a directory in C
functions?
There is no standard way. The most portable is the POSIX way :
opendir(), readdir() etc.
and how do I change current dir in C?




同上。我不记得POSIX方式的名称......在线查看POSIX

文档。

http://www.unix.org/version3/ieee_std.html


-

A +


Emmanuel Delahaye



Ditto. I can''t recall the name of the POSIX way... See the POSIX
documentation on line.

http://www.unix.org/version3/ieee_std.html

--
A+

Emmanuel Delahaye


#include< unistd.h>


char * getcwd(char * buf,size_t size);

char * get_current_dir_name(void);

char * getwd( char * buf);


#include< unistd.h>


char * getcwd(char * buf,size_t size);

char * get_current_dir_name(void);

char * getwd(char * buf);

#include <unistd.h>

char *getcwd(char *buf, size_t size);
char *get_current_dir_name(void);
char *getwd(char *buf);

#include <unistd.h>

char *getcwd(char *buf, size_t size);
char *get_current_dir_name(void);
char *getwd(char *buf);


Richard.C写道:


你在说什么?我当然不知道,因为我无法看到

您所回复的内容。


请在某些情况下离开以便人们可以看到你的内容如果您要发布对comp.lang.c的回复,请回复
。搜索

comp.lang.c中的条款Google和上下文有关如何执行此操作的说明


Richard.C wrote:

What are you talking about? I certainly have no idea since I can''t see
what you are replying to.

Please leave in some context so that people can see what you are
replying to if you are going to post replies to comp.lang.c. Search
comp.lang.c for the terms Google and context for instructions on how to
do this.
#include < unistd.h中>


这个标题不是标准C的一部分,因此在

comp.lang.c中关闭主题,所以如果你想谈谈它,请保持讨论

off comp.lang.c

char * getcwd(char * buf,size_t size);
char * get_current_dir_name(void);
char * getwd(char * buf);


用于C程序的完全可接受的原型。你的意思是?

#include< unistd.h>

char * getcwd(char * buf,size_t size);
char * get_current_dir_name(void) ;
char * getwd(char * buf);
#include <unistd.h>
This header is not part of standard C and is therefor off topic in
comp.lang.c, so if you want to talk about it please keep the discussion
off comp.lang.c
char *getcwd(char *buf, size_t size);
char *get_current_dir_name(void);
char *getwd(char *buf);
Perfectly acceptable prototypes for use in a C program. Your point is?
#include <unistd.h>

char *getcwd(char *buf, size_t size);
char *get_current_dir_name(void);
char *getwd(char *buf);




我第一次听到你了,不需要重复自己。

-

Flash Gordon

生活在有趣的时代。

虽然我的电子邮件地址说垃圾邮件,但这是真的,我读了。



I heard you the first time, no need to repeat yourself.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.


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

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