abattoir
6th June 2013, 23:53
Hi,

I know we can open/read/write/close any file preovided we know the filename and complete path to it.
But in my scneario, i have to read the files for which i dont know the complete path.
Below is an example of the directory structure for the EDI files i have to read :

Parent Directory Intermediate Directory Files
store_recv 060613-1544 810S
store_recv 060613-1244 810S
store_recv 060613-1244 850S
store_recv 060613-0528 850S

In the above example , i know the parent directory is always going to be (store_Recv) , even the files are going to be among (810S,850S..etc), but the issue is in intermediate directory. This Intermediate Directory naming convention is based on (Date-Time), so there is no way for me to guess the Intemediate Directory Name and hence no way to know the complete file path.

I was wondering if we have any function which can look for any files type under a parent directory something like *.* in store_recv directory, bypassing intermediate directory.

Thanks in Advance,
Abattoir

mark_h
6th June 2013, 23:59
Is this on a client machine or on the server itself? Look at the dir.* commands.

abattoir
7th June 2013, 03:57
Hi,

The Files are on the server and i have gone through dir.* commands but they don't really help in what i want to achieve.

Thanks,
Abattoir

JaapJD
7th June 2013, 09:23
dir.open() and dir.entry() don't help? You can do this on highest level and for each intermediate directory again.
Seems that you are on Unix. Then you can also use the run.prog() function with the "ls /store_recv/*/*" command.

vamsi_gujjula
7th June 2013, 12:01
yes as jaap said you can use run.prog() or shell() and other command that you might be interested is "find , grep"(linux) . write file names the fulfill your condition to a file say result.txt and open result.txt to get all file name that are of concern to you.

regards
vamsi.

abattoir
7th June 2013, 16:19
Thanks for the suggestion, I think i can get them to work now.

Thanks Again!!!
Abattoir