Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Avoid file download overlapping on Application server

premal_mistry2
Active Participant
0 Likes
996

Hi,

I have a functionality in which I am reading some files from application server, processing it and then downloading files with

data in it. The download filename is of format file_new_<timestamp>.

Now the problem is, due to fast processing the timestamp is not changing and thus instead of multiple files generating on application server only one file is generating.

A temporary solution is to use WAIT UP TO ... but this will seriously hit my programs performance..as the number of files are huge.

Thanks in advance.

7 REPLIES 7
Read only

MarcinPciak
Active Contributor
0 Likes
929

While getting timestamp use field of type TIMESTAMPL not TIMESTAMP. It is accurate to nano seconds so you will not have any issues with unique name.

Regards

Marcin

Read only

0 Likes
929

Hi Marcin,

Thanks for the reply... my requirement is that the filename should contain only TIMESTAMP and not TIMESTAMPL. I have already considered this but it is not applicable in my case ..

Read only

0 Likes
929

That's seems troublesome then. What you can do instead is to consider different directories as destination place. As the name wouldn't be unique for each second you could generate as many subcatalogs as files generated in one second. Tehn go back to the first and upload in the same sequence all the rest.

This would probalby produce thousands of dirs but as long as you have some automation process for downloading them back on presentation server this should not be a problem. I know it's a dirty way but the only one which comes to my mind. The best would be adjusting the requirements to include TIMESTAMPL in the name though.

Regards

Marcin

Read only

0 Likes
929

Hi Macin,

I agree with you ... that sure is a dirty way.. anyways thanks for the reply. Will lookout for more solutions.

Read only

0 Likes
929

It's not the best solution ever but...

Getting the timestamp at the beggining of the program and adding 1 to it for each new file created??

The timestamp won't be real but it seems it can't be real and unique at the same time.

Regards

Rafa

Read only

Former Member
0 Likes
929

Use the function module OCS_GET_FILE_INFO . It returns the time stamp of each and every file in the given path

Read only

Former Member
0 Likes
929

You have files being stored more frequently the one per second?  Amazing, but possible I suppose.  A simple question....you are issuing "get time" command just before constructing each new time stamp, aren't you?