Picture of Silvio 2739
Registered 9 years 27 days
Silvio 2739 Friday, 25 February 2022, 11:44 AM
Using files.h

I want to create a file that is needed for a process that I want to start. Unfortunately both functionalities are not available (at least not documented) for the "JavaScript library for App Services", so I have to use C++ which I have almost no experience with. However, to create instance specific files you recommended using common/interface/files.h in another thread and I managed to create a program using this lib. But when attempting to write a file it failes with "Start fopen() failed (2 : No such file or directory)", in both cases running using VS2019 and started in the AP Manager.

  • I created an IFilesProvider (as filesProvider) using CreateFilesProvider()
  • I created IFiles (as files) using filesProvider->CreateFiles() and provided AppService->GetAppServiceId() and dbName as documented
  • I tried to create IFilesWrite using files->Write() but this failes with the mentioned message

The documentation says that "/apps/<serviceId>/<dbName>.files [...] is a folder created by the taskmanager for the app", but when I look into the system there is only a /apps/<serviceId>/<dbName>.temp when the instance is running.

Am I missing something?

Andreas Fink
Moderator Registered 13 years 52 days
Andreas Fink (innovaphone) Friday, 25 February 2022, 01:00 PM
Re: Using files.h
Hello Silvio,

I would suggest to use JavaScript Runtime für App Services, in case you have less C++ experience.

Please take a look on the following parts of the JavaScript Runtime Documentation ( sdk.innovaphone.com -> Reference -> JavaScript Runtime)

https://sdk.innovaphone.com/13r2/doc/appgeneric.htm#config-dbfiles
https://sdk.innovaphone.com/13r2/doc/appgeneric.htm#client-DbFilesList


In case you prefer the C++ approach, give me a notice.

Best Regards
Andreas Fink
Picture of Silvio 2739
Registered 9 years 27 days
Silvio 2739 Friday, 25 February 2022, 01:34 PM
Re: Using files.h
Unfortunately this doesn't work for my use case. My goal is to start a 3rd-party binary, so I need common/interface/process.h. This program needs a configuration file which should be generated by the app. It has to be written to the file system, not in the database. I'd love to do this in JavaScript but as the JavaScript system lacks this functionality, that's not an option.
← You can define your color theme preference here