  | 
			
				SoftTree Technologies 
				Technical Support Forums
			 | 
		 
		  | 
	 
	 
	
	
	
		
	
	
	
		| Author | 
		Message | 
	 
	
		
			MightyMouse 
			 
			
  
			
			
				Joined: 27 Sep 2013 Posts: 16
  | 
			 
			  
		 | 
		
			
				  DirEx returns empty string | 
				     | 
			 
			
				Then using Dir "C:\\temp\\*.txt",  return I get a list of files.
 
 
When using DirEx C:\\temp\\*.txt",  return it return nothing, I need the full file path so I can then zip the files.
 
 
What am I mising?
  | 
			 
		  | 
	 
	
		| Thu Jun 04, 2015 1:15 pm | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				What do you get if you use it with *.* mask as opposite to *.txt?
  | 
			 
		  | 
	 
	
		| Thu Jun 04, 2015 2:25 pm | 
		          | 
	 
	
		  | 
	 
	
		
			MightyMouse 
			 
			
  
			
			
				Joined: 27 Sep 2013 Posts: 16
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Here is a better example of the code.
 
 
Dim file_folder String "C:\\Test\*.txt"
 
Dim file_list String
 
Dim zipfile String "C:\\Test\\ziptest.zip"
 
 
DirEx file_folder, file_list
 
FileZip, zipfile, file_list
 
 
The DirEx doesn't return any files, even though there are txt files in the folder.
  | 
			 
		  | 
	 
	
		| Thu Jun 04, 2015 2:42 pm | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Would you please answer my question? I still need to know what you get with *.*
  | 
			 
		  | 
	 
	
		| Thu Jun 04, 2015 3:09 pm | 
		          | 
	 
	
		  | 
	 
	
		
			MightyMouse 
			 
			
  
			
			
				Joined: 27 Sep 2013 Posts: 16
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Still nothing returned using the *.*, is there limit on the number of files??
  | 
			 
		  | 
	 
	
		| Thu Jun 04, 2015 3:32 pm | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				The limit should be 32 K if I get it correctly.
 
Now, would you please try FindFilesEx instead of DirEX. Does that work for you?
 
 
Which version of 24x7 are you running?
  | 
			 
		  | 
	 
	
		| Thu Jun 04, 2015 3:50 pm | 
		          | 
	 
	
		  | 
	 
	
		
			MightyMouse 
			 
			
  
			
			
				Joined: 27 Sep 2013 Posts: 16
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				There are over 50K files.
 
Version 5.1 Build 405
  | 
			 
		  | 
	 
	
		| Thu Jun 04, 2015 4:01 pm | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				
	  | 
	
 
	  | 
	There are over 50K files.  | 
	 
 
 
This could be it.
 
 
But here are 2 simple workaround. To me the second method seems to be more elegant.
 
 
1. Instead of using DirEx statement in JAL, you can obtain file listing by spawning an external DOS dir command. 
 
 
	  | 
	
 
	  | 
	Dim process_id, number
 
Dim output, string
 
 
// Run "dir" in bare format and capture output
 
RunAndWait( "cmd /C dir C:\\temp\\*.txt /B /S >> C:\\some_folder\\dir_out.txt" , "", 0, process_id )
 
// Read the output file for error checking
 
FileReadAll( "C:\\some_folder\\dir_out.txt", output )
 
// .. parse the list and do something with the files ... | 
	 
 
 
 
2. Using FileFindFirst and FileFindNext
 
 
	  | 
	
 
	  | 
	Dim found, boolean
 
Dim fileName, string
 
 
FileFindFirst( "C:\\temp\\*.txt", fileName, found )
 
LoopWhile( found, END_LOOP )
 
   // add path
 
   Concat( "C:\\temp\\", fileName, fileName )
 
   // ... do something with the file here ...
 
 
   // get next file
 
   FileFindNext( fileName, found )
 
END_LOOP: | 
	 
 
  | 
			 
		  | 
	 
	
		| Fri Jun 05, 2015 12:50 am | 
		          | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
	 
	    
	   | 
	
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
  | 
   
 
		 | 
	 
	  |