ElmerGUI flattens geometry, CAD, and other related files
Posted: 03 Jan 2011, 23:18
Hi,
I've been noticing that from time to time my geometry, CAD, and other files in my Elmer simulation directory get flattened, i.e. become zero-byte files. I finally got some time last week to track this down, and it looks like it is in ElmerGUI/Application/src/mainwindow.cpp lines 1533-1559:
Trouble is, even when g_path is the same as p_path, the != comparison often returns true, copying the files to themselves. And of course opening dst creates a zero-length file, destroying src. I am not seeing the "not copied" log message. When I insert a logMessage before the conditional to print g_path and p_path, they print identically. And when I put a logMessage in the "true" part of the conditional, it prints, indicating that it enters the copying loop. And it doesn't just do this for the geometry file, but for all files with the same basename, so the original CAD or gmsh .geo file gets flattened and I need to start absolutely from scratch.
Why does Elmer try to copy these files? And if you really want to copy the geometry files, e.g. .stp or .msh, do you really need to copy everything with the same basename, when Elmer can't read .geo or .fcstd etc.? And if you really want to copy all of the files, isn't there a better way, e.g. using a system file copy command which returns an error if the files are the same, instead of reading the contents from one file to the other and flattening them by accident?
This is on Ubuntu 10.04. For my own purposes, I'm commenting this whole section for now.
-Adam
I've been noticing that from time to time my geometry, CAD, and other files in my Elmer simulation directory get flattened, i.e. become zero-byte files. I finally got some time last week to track this down, and it looks like it is in ElmerGUI/Application/src/mainwindow.cpp lines 1533-1559:
Code: Select all
// Avoid copying file(s) into it self:
if( g_path != p_path ) {
[open src and dst, and copy contents from src to dst]
} else {
logMessage("Geometry input file(s) not copied");
}
Why does Elmer try to copy these files? And if you really want to copy the geometry files, e.g. .stp or .msh, do you really need to copy everything with the same basename, when Elmer can't read .geo or .fcstd etc.? And if you really want to copy all of the files, isn't there a better way, e.g. using a system file copy command which returns an error if the files are the same, instead of reading the contents from one file to the other and flattening them by accident?
This is on Ubuntu 10.04. For my own purposes, I'm commenting this whole section for now.
-Adam