c语言目录操作函数

Python017

c语言目录操作函数,第1张

我不知道楼主具体指的是什么?什么叫取得目录中的函数名?是指文件名吗?

如果是的话,看这个程序:

#include

<process.h>

main()

{

clrscr()

system("dir

e:\\younger")

/*"e:\\younger"可以改成任意目录*/

getch()

}这样可以吗,楼主?

新建目录的方法:

#include <direct.h>

#include <stdlib.h>

#include <stdio.h>

int main( void )

{

if( _mkdir( "\\testtmp" ) == 0 )

{

printf( "Directory '\\testtmp' was successfully created\n" )

system( "dir \\testtmp" )

if( _rmdir( "\\testtmp" ) == 0 )

printf( "Directory '\\testtmp' was successfully removed\n" )

else

printf( "Problem removing directory '\\testtmp'\n" )

}

else

printf( "Problem creating directory '\\testtmp'\n" )

}