_chdir, _wchdir
北冥工作室吧
全部回复
仅看楼主
level 6
ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vccrt/html/85e9393b-62ac-45d5-ab2a-fa2217f6152e.htm
2007年10月08日 07点10分 1
level 6
// crt_chdir.c// arguments: C:\WINDOWS/* This program uses the _chdir function to verify that a given directory exists. */#include
#include
#include
#include
int main( int argc, char *argv[] ){ if(_chdir( argv[1] ) ) { switch (errno) { case ENOENT: printf( "Unable to locate the directory: %s\n", argv[1] ); break; case EINVAL: printf( "Invalid buffer.\n"); break; default: printf( "Unknown error.\n"); } } else system( "dir *.exe");}
2007年10月08日 07点10分 2
level 6
system( "dir *.exe"); 是个好东西
2007年10月08日 07点10分 3
1