1. Kim Berghall
  2. PowerBuilder
  3. Wednesday, 28 March 2018 18:58 PM UTC

PB Help says to use FileLength after FileClose to avoid sharing violation. Can someone explain that or anyone having experience with it?

Started to get errors on file read using PFC on a new 2016 server, so it might be some encoding issue, but was curios about that comment, if it needs to be done?

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 28 March 2018 21:04 PM UTC
  2. PowerBuilder
  3. # 1

Hi Kim;

      Check the PFC code. It might still be using the old FileRead (  ) command vs the newer FileReadEx ( ) command found in newer PB Versions. This might be the issue. Also, using either Read command flavours - after the FileClose ( ) method is run, the lock on the File should be removed. This might be an issue if you are using an older PB Version (you did not mention the PB version & build).

    That brings up another good point in that the PFC code to read a file should not be placing a lock on any file. Check the FileOpen ( ) command parameters. Any file opened for basic read mode should use the FileAccess setting Read! and the FileLock option Shared! - otherwise yes, locking would be an unnecessary issue imposed.

HTH

Regards .... Chris

Comment
  1. Kim Berghall
  2. Wednesday, 28 March 2018 22:24 PM UTC
Thanks, we will take those two answers into consideration. The old version of PB is 9.01 it has been working fine until the file share was moved to a Win 2016 box. We will update to use FileReadEx and FileWriteEx in PB 2017. Ironically the recently released 1769 says that there was a bug fixed. However the description of that fix is very cryptic, one can't figure out what the problem was... It says "FileReadEx function fails to read content from the file (length null) and returns the value 3. So now I don't know if PB 2017 R2 build 1756 has a bug or not or what the bug is. We are holding off installing 1769 until Appeon provides the upgrade capability, it is a hassle to first having to uninstall the old version...

  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 29 March 2018 15:26 PM UTC
The direct upgrade EBF will be available in early April.



Sorry for the inconvenience.

  1. Helpful
There are no comments made yet.
Alfredo Aldama Accepted Answer Pending Moderation
  1. Wednesday, 28 March 2018 19:36 PM UTC
  2. PowerBuilder
  3. # 2

Hola,

En mi opinion al ser un archivo que puede ser compartido o de uso exclusivo  es la forma en la que [valida | refresca ] si este sigue en uso, tambien es usada esta función cuando el archivo esta en un drive lógico, en ocasiones hay interrupciones en la red, hacer esto al parecer  refresca la conexión y actualiza el estado del archivo.

Saludos !

Comment
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.