luciliacoelho
asked on
Default path- default disk drive - error file
Normally I use my default path and error log file location hard coded in my main program.
If the environment is always stand alone we do not have any issues with this approach.
When we simultaneously have the same application deployed for stand alone and multi-user environments we need to change the code to redirect the default path and error file location (this is a DBF free table that I leave) from the C:\ drive to a shared network Drive named as W:\ for instance.
Can this locations and default disk os default path for Visual Fox be configured out of the code, I would say in the config file config.fwp?
If the environment is always stand alone we do not have any issues with this approach.
When we simultaneously have the same application deployed for stand alone and multi-user environments we need to change the code to redirect the default path and error file location (this is a DBF free table that I leave) from the C:\ drive to a shared network Drive named as W:\ for instance.
Can this locations and default disk os default path for Visual Fox be configured out of the code, I would say in the config file config.fwp?
? JUSTDRIVE(SYS(2019,1))
What I mean is follow where the config file is if that might solve your problem. If it's on F then you assign F.
If am using CONFIG.DBF which is placed in the same folder as the app.EXE and may contain data pathes and other info required at program start. If the CONFIG.DBF is empty or missing then I suppose data are in the DATA subfolder of the app folder retrieved by SYS(16) function call.
No hardcoded disk drive and/or path exists in the code. Thus, I may move the application together with data almost anywhere without any change in its code.
It is better to leave at operating system decision where to place temp files since Vista. I am using SYS(2023) to determine where to save text error logs and other temporary files. The error log is also replicated in DBF which is a standard part of the application data.
No hardcoded disk drive and/or path exists in the code. Thus, I may move the application together with data almost anywhere without any change in its code.
It is better to leave at operating system decision where to place temp files since Vista. I am using SYS(2023) to determine where to save text error logs and other temporary files. The error log is also replicated in DBF which is a standard part of the application data.
ASKER
Cyril Captain
I've tried "? JUSTDRIVE(SYS(2019,1))" and within a messagebox but nothing returned on my screen.
Something wrong on my side?
I've tried "? JUSTDRIVE(SYS(2019,1))" and within a messagebox but nothing returned on my screen.
Something wrong on my side?
It means that you don't have a config.fpw set up for the application.
I also do not hard code anything. I read the temp folders from the system and it behaves differently for 98/XP/Vista and 7.
The error and log files are in the main directory and there is the id of the user and email is sent upon confirmation of user. The error log can be dumped out on request.
You can also use SYS(16) to check where the program is executed from.
I also do not hard code anything. I read the temp folders from the system and it behaves differently for 98/XP/Vista and 7.
The error and log files are in the main directory and there is the id of the user and email is sent upon confirmation of user. The error log can be dumped out on request.
You can also use SYS(16) to check where the program is executed from.
It just means your app or FoxPro does not use external CONFIG.FPW file.
ASKER
Pcelba,
I try to includ in config.fpw file the path i want to my application, but i don´t know i can activate this file.
I try to includ in config.fpw file the path i want to my application, but i don´t know i can activate this file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.