Opendir in C Programming Software Development by CharAmel … understand. What's the meaning of "./" in `DS = opendir ("./");` I have searched a lot of sites about… Dir /s command using opendir function Programming Software Development by gameon … *path) { DIR *d,*d1; struct dirent *dir; chdir(path); d=opendir("."); if(d) while((dir=readdir(d))) if(!strcmp…; else { printf("%s\n",dir->d_name); d1=opendir(dir->d_name); if(d1) { list(dir->d_name); } } closedir… Re: Dir /s command using opendir function Programming Software Development by gameon … using? Looks like os is MS-Windows but using *nix opendir() and associated functions. In any event, you don't need… what are you saying.should i use another function because opendir is for *nix os. PHP opendir Programming Web Development by shuka79 Hi Guys I am currently using the opendir to display all files and folders in a specific directory …> <? $folder = "../course/".$dir.""; $handle = opendir($folder); # Making an array containing the files in the current… Re: Dir /s command using opendir function Programming Software Development by Ancient Dragon What compiler are you using? Looks like os is MS-Windows but using *nix opendir() and associated functions. In any event, you don't need to use chdir(). Just call list() recursively for each subdirectory that's encountered. Re: Opendir in C Programming Software Development by rubberman The "./" means "use the current directory where your application is running". The dot is the current directory. If it was "../" it would point to the directory above where you are. If it was "~/" then it would point to your home directory. Re: Opendir in C Programming Software Development by CharAmel Thank you for your answer! Re: Opendir in C Programming Software Development by rubberman NP. Sometimes reading the manual helps... :-) In any case, it was a sensible question for a newbie. Sometimes what is obvious to us "old-timers" isn't so to newer programmers. Re: Dir /s command using opendir function Programming Software Development by Ancient Dragon I've only seen it used with *nix compilers, but if yours supports it then it should be ok. The main thing is to use a recursive function call when a directory is encountered. Re: Dir /s command using opendir function Programming Software Development by gameon [QUOTE=Ancient Dragon;1314025]I've only seen it used with *nix compilers, but if yours supports it then it should be ok. The main thing is to use a recursive function call when a directory is encountered.[/QUOTE] thanks ancient dragon for your help and i want some more help. I did this program with findfirstfile and findnextfile it run well.… Re: Dir /s command using opendir function Programming Software Development by Ancient Dragon I guess that _getdirves() reutnrs a bit mapped integer of the drive letters on the computer. So that the first bit is drive 'A', the second is drive 'B', etc. [code] char path[255] = {0}; unsigned int get = _getdrives(); for(int i 1; i < 26; i++) { if( get & 1 ) { path[0] = 'A' + (i-1); strcat(path,"… Re: Dir /s command using opendir function Programming Software Development by gameon [QUOTE=Ancient Dragon;1314278]I guess that _getdirves() reutnrs a bit mapped integer of the drive letters on the computer. So that the first bit is drive 'A', the second is drive 'B', etc. [code] char path[255] = {0}; unsigned int get = _getdrives(); for(int i 1; i < 26; i++) { if( get & 1 ) { path[0] = 'A' + (i-1);… Re: Dir /s command using opendir function Programming Software Development by Ancient Dragon put a disk in the drive :) Re: Dir /s command using opendir function Programming Software Development by gameon [QUOTE=Ancient Dragon;1314724]put a disk in the drive :)[/QUOTE] my question is that , there is any way that detects drive is ready for use or not. Re: Dir /s command using opendir function Programming Software Development by Ancient Dragon I don't know. There was a way under MS-DOS 6.X. I thought M$ may have made it a Windows Hook, but I don't see anything that would be useful to you there. [URL="http://www.bigresource.com/VB-How-to-check-whether-floppy-drive-is-ready--N86jFSt3Xc.html"]You might read these links[/URL] Re: PHP opendir Programming Web Development by cereal Works fine for me, maybe it's the **$dir** variable? As suggestion use `print_r()` on line 11, just before the while loop, to check the **$files** array: print_r($files); Re: PHP opendir Programming Web Development by shuka79 Thanks for your reply I have put in the print_r, the the output included duplicates still I have also hardcode in the directory instead of using $dir variable but not made any difference. Cheers Neil Re: PHP opendir Programming Web Development by blocblue >I have used the same code on another part of the site and it works perfectly. I don't see that you've reinitialised the `$files` array anywhere. It could be populated with the results of the last time you used the code. Add `$files = array();` immediately after line 4. Re: PHP opendir Programming Web Development by shuka79 Thanks blocblue that has sorted it :) uploading to ftp server my directory hae some problom Programming Web Development by asifkamalzahid …remote_dir); echo "successfully created $remote_dir\n"; $handle = opendir($local_dir); while (($file = readdir($handle)) !== false) { if … this error message[/COLOR] Warning: opendir(/c) [function.opendir]: failed to open dir: No such…php on line 66 successfullPHP Warning: opendir(/c) [function.opendir]: failed to open dir: No… Duplicates project : Programming Software Development by dhandb01 … struct dirent *dit; int i=0; if ((dip = opendir(directoryName)) == NULL) { perror("opendir"); return 0; } while ((dit = readdir(dip)) …i = 0; struct stat sb; if ((dip = opendir(directoryName)) == NULL) { perror("opendir"); return; } strcat(directoryName,"/"); char currentFile… PHP FTP Loop (with dynamic inputs) Programming Web Development by atrophiedsoul …wintercnt-1; $summercnt=0; $summerdirname="images/summer"; $summerdn=opendir($summerdirname); while ($dircount=readdir($summerdn)) { $summercnt=$summercnt+1; }…-1; $springcnt=0; $springdirname="images/spring"; $springdn=opendir($springdirname); while ($dircount=readdir($springdn)) { $springcnt=$springcnt+1; }… Stream line some code (help) Programming Web Development by atrophiedsoul …wintercnt-1; $summercnt=0; $summerdirname="images/summer"; $summerdn=opendir($summerdirname); while ($dircount=readdir($summerdn)) { $summercnt=$summercnt+1; }…-1; $springcnt=0; $springdirname="images/spring"; $springdn=opendir($springdirname); while ($dircount=readdir($springdn)) { $springcnt=$springcnt+1; }… Re: Displaying a directorys contents problem Programming Web Development by Airshow …. You need something like: [LIST][*][ICODE]$myDirectory = opendir("./myDir");[/ICODE] (a dir within the current…] (a dir one level up) [*][ICODE]$myDirectory = opendir("../../myDir");[/ICODE] (a dir two levels up)… [*][ICODE]$myDirectory = opendir("../myDir1/myDir2");[/ICODE] (a dir up one… 'Value' shpuld be between 'minimum' and 'maximum' Programming Software Development by DioRani … void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { play2(opendir + "/" + e.Node.Text); }…private void playlist2_NodeMouseDoubleClick_1(object sender, TreeNodeMouseClickEventArgs e) { play2(opendir + "/" + e.Node.Text); } private… Troubles with DIR * and dirent- linux enviroment Programming Software Development by Despairy … that has to open a folder using DIR * `DIR * directory=openDir(...); // openDir is a function returning DIR * after it was opened` than… works and i get into the loop DIR *dirr=openDir(path);// same openDir function from above while(ent=readdir(dirr)){stuff} i… Writing files to a different directories & sub directories Programming Web Development by ska_defender … != '..')&&($file != 'index.htm')) { $folder2 = opendir($path[1]); $folder3 = opendir($path[2]); $folder4 = opendir($path[3]); $imagename =''; $txtname =''; $related =''; while… upload_process Programming Web Development by davy_yg …']); $passfeid = (isset($_GET['feid']) ? '&feid='.$_GET['feid'] : ''); if ($handle = opendir($folder)) { while (false !== ($file = readdir($handle))) { if ($file != "."…; </body> </html> line 17: if ($handle = opendir($folder)) line 79: if($total>0 && $bad… Display Directory Content in Socket API Hardware and Software Linux and Unix by Corey_3 …buf), 0); } printf("n: %d\n", n); dr = opendir("./"); if (dr != NULL) { while (en = readdur(dp)) puts…;:"s."); send(sd2,buf,strlen(buf),0); dr = opendir("./"); if (dr != NULL) { while (en = readdur(dp)) { … Re: upload_process Programming Web Development by davy_yg …;dupfiles='.$dup); echo $folder;} ?> Warning: opendir(E:/xampp/xampp/htdocs/images/uploads/) [function.opendir]: failed to open dir: Invalid argument in…/uploads/ You won't see this. line 17: if ($handle = opendir($folder)) line 79: if($total>0 && $bad…