1. Steve DeWitt
  2. PowerBuilder
  3. Tuesday, 5 May 2020 22:25 PM UTC

We have recently migrated to PB 2019 from PB 10. We migrated several applications, half a dozen, and one in particular has an issue when trying to use filemove. We are getting -2 "Error writing targetfile". the file does not exist on the target. We are using UUIDs for the file names. This is a reporting application that produces pdfs from datawindows. The PB10 version never had this issue.

Any suggestions would be helpful. It doesn't fail all the time. The file size is 800K. It works every now and then. It is mainly one report. The reports all use the same ancestor object to do the filemove. We checked the target server to make sure there is enough disk space, checked that the filename doesn't exist on the target server. We build using orcascr190.exe script.

The application is moving the file to a network share that is a mapped drive not using UNC

We are out of ideas.

TIA,

Steve DeWitt

Olan Knight Accepted Answer Pending Moderation
  1. Wednesday, 6 May 2020 16:52 PM UTC
  2. PowerBuilder
  3. # 1

Steve -

If the FileMove command failed with a -2, try using FileCopy followed by deleting the source copy of the file if the COPY worked.

Also, check the RIGHTS associated with the user trying to do the Move and/or Copy.


Good Luck,

Olan

Comment
There are no comments made yet.
Steve DeWitt Accepted Answer Pending Moderation
  1. Wednesday, 6 May 2020 15:58 PM UTC
  2. PowerBuilder
  3. # 2

reran the PB10 version of the app and the datawindow print method only pushes 9MB of data to the pdf distiller.

Why is the PB2019 datawindow.print() method pushing so much data? Can this be changed? 

Comment
There are no comments made yet.
Steve DeWitt Accepted Answer Pending Moderation
  1. Wednesday, 6 May 2020 15:24 PM UTC
  2. PowerBuilder
  3. # 3

We have made a change to sleep(30) if the filemove fails with -2. this seems to solve the issue for now. The file is still growing and that is why it fails to move. I would have thought that this was a source file error, -1, and not a target file error of -2

We use a pdf distiller to print the reports as pdfs. This is the same version we used with PB10. Does the datawindow print in PB2019 send more data to the print queue than PB10 did? The print queue is reporting that there is 22MB of data when printing and the file size is 800K. we never looked at this before so I don't know the answer myself.

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 6 May 2020 17:35 PM UTC
Hi Steve ... Super glad that the sleep/retry worked for you!

The Distill! option still sends basically "PostScript" the same as before.

What PostScript printer / driver are you using?
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 6 May 2020 14:31 PM UTC
  2. PowerBuilder
  3. # 4

Hi, Steve - 

I don't know if any of these options are workable for your particular situation:

1. Try using the FileCopy/FileDelete PowerScript functions instead of FileMove, maybe just with very large files.

2. Use Windows' Robocopy utility (command prompt) via ShellExecuteW or ShellExecuteExW WinAPI commands (refer to the RunAndWait free code example program on Roland Smith's TopWizProgramming web site). Robocopy is pretty robust and has a /MOVE option...type ROBOCOPY /? from a command prompt to see all available options. It also has retry options and logging options. You could also use a .BAT file to encapsulate the Robocopy command(s).

HTH, John

Comment
There are no comments made yet.
Steve DeWitt Accepted Answer Pending Moderation
  1. Wednesday, 6 May 2020 12:52 PM UTC
  2. PowerBuilder
  3. # 5

We have tried a yield() and a sleep(). we have also tried the filemove again when it fails with a -2.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 6 May 2020 00:41 AM UTC
  2. PowerBuilder
  3. # 6

Hi Steve;

   Just wondering if it's somekind of "contention" issue? If so, maybe a Yield() command & then a "retry" (or two) might get around this issue? Food for thought. HTH

Regards ... Chris

Comment
  1. Steve DeWitt
  2. Wednesday, 6 May 2020 17:01 PM UTC
that didn't work either.

This is an issue with the amount of data that gets pushed to the pdf distiller. This has changed in PB2019. We upgraded our version of the distiller we use and that seems to have solved the issue.
  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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.