SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
DirEx returns empty string

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
DirEx returns empty string
Author Message
MightyMouse



Joined: 27 Sep 2013
Posts: 16

Post DirEx returns empty string Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6507

Post Reply with quote
What do you get if you use it with *.* mask as opposite to *.txt?
Thu Jun 04, 2015 2:25 pm View user's profile Send private message
MightyMouse



Joined: 27 Sep 2013
Posts: 16

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6507

Post Reply with quote
Would you please answer my question? I still need to know what you get with *.*
Thu Jun 04, 2015 3:09 pm View user's profile Send private message
MightyMouse



Joined: 27 Sep 2013
Posts: 16

Post Reply with quote
Still nothing returned using the *.*, is there limit on the number of files??
Thu Jun 04, 2015 3:32 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6507

Post Reply with quote
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 View user's profile Send private message
MightyMouse



Joined: 27 Sep 2013
Posts: 16

Post Reply with quote
There are over 50K files.
Version 5.1 Build 405
Thu Jun 04, 2015 4:01 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6507

Post Reply with quote
Quote:
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.

Code:
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

Code:
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 View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.