1. John Vanleeuwe
  2. PowerBuilder
  3. Thursday, 13 December 2018 12:07 PM UTC

Hi guys,

We have implemented a solution where our app is checking for the existence of txt files in a certain folder. Another application is sending to us TXT files , which we need to process and delete when done.

 

We used the Dirlist method and this works almost perfect.  Problem is our customer wants us to handle the incoming files by date-time stamp and not in the alfabetically order of the filename which is used by the dirlist method.

 

I've done some searching and found a few suggestions of using an external datawindow , then FindFirst file api and so on to feed the datastore with the filename and timestamp , sort the datastore and then start processing.

 

This seems to me like so much overhead, wouldn't it be easier if APPEON could extend the Dirlist function with an extra parameter where you can decide the sorting order of the result set ?

 

TIA

John

Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 13 December 2018 17:38 PM UTC
  2. PowerBuilder
  3. # 1

A possible problem with DirList is that it changes the app current directory.

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 13 December 2018 18:16 PM UTC
Hi Roland;

Good point but .. nothing a good GetCurrentDirectory ( ) before the DirlIst() and ChangeDirectory ( ) afterwards would not fix. ;-)

Regards ... Chris
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 13 December 2018 15:24 PM UTC
  2. PowerBuilder
  3. # 2

Hi John;

  Yes, adapting File API approach and placing that into a DW & then sorting it by the files Date & Time - would be what I would do.

FYI:  http://www.topwizprogramming.com/freecode_filesys.html

Regards ... Chris

Comment
  1. John Vanleeuwe
  2. Thursday, 13 December 2018 16:39 PM UTC
Hi Chris,



Thanks , i wanted to avoid this approach , i think it would be a bonus to have a sorting option for the powerbuilder Dirlist function. So we dont have to use any apis.



Can i post this suggestion to APPEON ?



TIA

John
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.