kopia lustrzana https://github.com/jamescoxon/dl-fldigi
NBEMS.DIR
* Modify test for NBEMS.DIR file presence to show more info in event log. - be careful when creating the NBEMS.DIR file on Windows. Windows has a habit of adding it's own concept of what the file name extension should be. For example: - XP named the file NBEMS.DIR.txt when a blank file was created using the file explorer metaphor. - NBEMS apps could not find the file and the ".txt" extension is hidden from the users view in the file explorer.pull/1/head
rodzic
cb820aeaa7
commit
614a54274d
23
src/main.cxx
23
src/main.cxx
|
@ -239,8 +239,10 @@ void delayed_startup(void *)
|
||||||
int main(int argc, char ** argv)
|
int main(int argc, char ** argv)
|
||||||
{
|
{
|
||||||
appname = argv[0];
|
appname = argv[0];
|
||||||
|
string appdir;
|
||||||
|
string test_file_name;
|
||||||
|
FILE *test_file = NULL;
|
||||||
{
|
{
|
||||||
string appdir;
|
|
||||||
char apptemp[FL_PATH_MAX];
|
char apptemp[FL_PATH_MAX];
|
||||||
fl_filename_expand(apptemp, sizeof(apptemp), appname.c_str());
|
fl_filename_expand(apptemp, sizeof(apptemp), appname.c_str());
|
||||||
appdir.assign(apptemp);
|
appdir.assign(apptemp);
|
||||||
|
@ -258,11 +260,14 @@ int main(int argc, char ** argv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (p != std::string::npos) {
|
if (p != std::string::npos) {
|
||||||
string testfile;
|
test_file_name.assign(appdir).append("NBEMS.DIR");
|
||||||
testfile.assign(appdir).append("NBEMS.DIR");
|
#ifdef __WOE32__
|
||||||
FILE *testdir = fopen(testfile.c_str(),"r");
|
while ((p = test_file_name.find("\\")) != std::string::npos)
|
||||||
if (testdir) {
|
test_file_name[p] = '/';
|
||||||
fclose(testdir);
|
#endif
|
||||||
|
test_file = fopen(test_file_name.c_str(),"r");
|
||||||
|
if (test_file != NULL) {
|
||||||
|
fclose(test_file);
|
||||||
BaseDir = appdir;
|
BaseDir = appdir;
|
||||||
NBEMSapps_dir = true;
|
NBEMSapps_dir = true;
|
||||||
}
|
}
|
||||||
|
@ -348,7 +353,11 @@ int main(int argc, char ** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_INFO("appname: %s", appname.c_str());
|
LOG_INFO("appname: %s", appname.c_str());
|
||||||
|
LOG_INFO("Test file %p", test_file);
|
||||||
|
if (NBEMSapps_dir)
|
||||||
|
LOG_INFO("%s present", test_file_name.c_str());
|
||||||
|
else
|
||||||
|
LOG_INFO("%s not present", test_file_name.c_str());
|
||||||
LOG_INFO("HomeDir: %s", HomeDir.c_str());
|
LOG_INFO("HomeDir: %s", HomeDir.c_str());
|
||||||
LOG_INFO("RigsDir: %s", RigsDir.c_str());
|
LOG_INFO("RigsDir: %s", RigsDir.c_str());
|
||||||
LOG_INFO("ScriptsDir: %s", ScriptsDir.c_str());
|
LOG_INFO("ScriptsDir: %s", ScriptsDir.c_str());
|
||||||
|
|
Ładowanie…
Reference in New Issue