Solved

Default path- default disk drive - error file

Posted on 2011-09-27
8
426 Views
Last Modified: 2012-06-27
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?
0
Comment
Question by:luciliacoelho
  • 4
  • 2
  • 2
8 Comments
 
LVL 27

Expert Comment

by:CaptainCyril
Comment Utility
? JUSTDRIVE(SYS(2019,1))
0
 
LVL 27

Expert Comment

by:CaptainCyril
Comment Utility
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.
0
 
LVL 41

Expert Comment

by:pcelba
Comment Utility
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.
0
 

Author Comment

by:luciliacoelho
Comment Utility
Cyril Captain
I've tried "? JUSTDRIVE(SYS(2019,1))" and within a messagebox but nothing returned on my screen.
Something wrong on my side?
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 27

Expert Comment

by:CaptainCyril
Comment Utility
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.
0
 
LVL 41

Expert Comment

by:pcelba
Comment Utility
It just means your app or FoxPro does not use external CONFIG.FPW file.
0
 

Author Comment

by:luciliacoelho
Comment Utility
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.
0
 
LVL 27

Accepted Solution

by:
CaptainCyril earned 500 total points
Comment Utility
You create or edit it via notepad or FoxPro.
It needs to be in the same folder as the exe. Once you load the exe it loads with it.

In the development version, there might be another config.fpw which might or might contain the same settings. The other one is in the main folder of FoxPro and not your project.

You can force FoxPro to load a specific config.fpw by calling it with the -c parameter.

How to: Create a Configuration File
http://msdn.microsoft.com/en-us/library/377x0zxd(v=vs.80).aspx

Setting Configuration Options at Startup
http://msdn.microsoft.com/en-us/library/aa977194(v=vs.71).aspx
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now