vishbaan
29th March 2004, 13:13
URGENT : I want to read the files in a directory
dear fnds,

this thread on ottdllfilehand helped me a lot.

But I have a problem.

We have a file pool directory in the baan server. Text files will keep coming in to this directory from many POS systems remote.

I dont know the file name; First I want to a fetch a file from this directory and use that file for appending a baan table and then move the file to another archive folder (move.file() helps here) and then move on to next file.

How to fetch a file from a pre-defined directory one by one using the program script. Can "ottdllfilehand" help? I dont know the file name, I want to read the directory and obtain the files one by one, HOW DO I DO THAT?

any work-arounds, suggestions pls.

Best regards

VISH

JaapJD
29th March 2004, 13:28
You can use dir.open, dir.entry and dir.close.

vishbaan
29th March 2004, 15:13
hi

tks for ur input,

like the file.present(), copy.file() are functions part of dll ottdllfilehand, (I used #pragma used dll ottdllfilehand in my program script)

can u pls tell me,

these dir* functions u mentioned belong to which dll or include.

vish

JaapJD
29th March 2004, 15:18
Those functions are bshell-functions, so no include or dll needed. They are for at least 5 years present in the porting-set.

vishbaan
29th March 2004, 15:54
dr jaap'

yeah, i used the dir.open("var.dir"), it compiled without any error.

But i want it to read the file names, how to do that..

does it return a list of files, is there a help / syntax available for these dir functions

thanks

vish

JaapJD
29th March 2004, 15:56
See the online programmers manual:

http://www.baanboard.com/programmers_manual_baanerp_help_functions_directory_file_operations_dir_entry

vishbaan
29th March 2004, 16:26
dr jaap'

thanks and a great help indeed.

it worked as expected

i used, dir.open() and dir.entry() functions

thanks

vish

deepaksachdeva
2nd November 2006, 19:02
dr jaap'

thanks and a great help indeed.

it worked as expected

i used, dir.open() and dir.entry() functions

thanks

vish
Hi Vish;
i also have same kind of requirement, as u have; could u please paste the code to help me understand further

With regards
Deepak

en@frrom
6th November 2006, 11:18
See this thread (http://www.baanboard.com/baanboard/showthread.php?t=7414) for more information and a sample code

gget79
3rd December 2014, 21:57
Please review the follow link:

http://www.baanboard.com/baanboard/showthread.php?t=9091&highlight=dir.entry