1. Andrew Davis
  2. PowerBuilder
  3. Wednesday, 24 October 2018 15:07 PM UTC

Hi 

I need to access some text files from my application ( Pb2018r3 ) 

How do i display the information on the file for example the file date time and size ?

thanks in advance

 

Andrew

 

 

John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 24 October 2018 15:39 PM UTC
  2. PowerBuilder
  3. # 1

You will likely need to utilize some Windows API calls via local external function declarations, such as GetFileTime and FindFirstFileW. If your app is based on the PowerBuilder Foundation Class (PFC) framework, the File Service objects (pfc_n_cst_filesrv & pfc_n_cst_filesrvunicode contain both the WinAPI function declarations and code to use them.

If you are not using the PFC, you could obtain the PFC libraries and inspect the code in these objects (both of the non-visual objects I have mentioned reside in the pfcapsrv.pbl. The PFC libraries are available to anyone on GitHub.

Also visit Roland Smith's TopWizProgramming web site. It contains free sample code addressing a wide variety of topics. Download & check out his Filesys app.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 24 October 2018 15:26 PM UTC
  2. PowerBuilder
  3. # 2

Hi Andrew;

There are a few ways ....

  1. Have a look at PB's DirList ( ) command for that.
  2. Use the GetFileOpenName ( ) command as well to open the O/S dialogue that shows the file details.
  3. Use the O/S's SDK commands - GetFileVersionInfoSize and GetFileVersionInfo
  4. Perform a DOS "Dir *.*" command and pipe that to a file to be read by your PB App


HTH

Regards ... Chris

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.