-dict argument assumes name starting with './' is relative to the case (instead of pwd) directory
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Link issues together to show that they're related. Learn more.
Activity
- Mattijs Janssens mentioned in commit ca3f295138b4e3dfd3bbae97a24fc86dcc536296
mentioned in commit ca3f295138b4e3dfd3bbae97a24fc86dcc536296
- Author Maintainer
E.g. in
IOobject::path() const
there is handling for absolute paths ('/') but not for '.'.
E.g.
This is valid: cd ~ topoSet -case $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity -dict system/topoSetDict
but this should fail:
topoSet -case $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity -dict ./system/topoSetDict
(since there is no $PWD/system/controlDict)
- Admin added ~15 label
added ~15 label
By Andrew Heather on 2017-06-21T21:05:43 (imported from GitLab project)
- Admin changed milestone to %Version v1706
changed milestone to %Version v1706
By Andrew Heather on 2017-06-21T21:05:43 (imported from GitLab project)
- Mark OLESEN assigned to @mark
assigned to @mark
- Mark OLESEN changed milestone to %v1712
changed milestone to %v1712
- Maintainer
Maybe your example was poor since it actually does properly fail for me, but for different reasons. The
dictPath.expand()
that topoSet.C uses indirectly via thesetSystemMeshDictionaryIO.H
replaces with the cwd and means the non-existent file is resolved properly. Nonetheless I see what you mean, especially if I use "../path/file".This means that a file-path in the IOobject constructor that starts with a
/
or.
should be treated similarly as being outside-the-case. This trickles through to the path() as well.- could add fileName expand into IOobject::fileNameComponents, which might be easier and more convenient than having every caller do it. Or causes mayhem since people lose control?
I'm not actually sure that the string expansion of a leading "./" into cwd is such a great idea after all.
Thoughts @andy?
- Author Maintainer
topoSet fails for me as well (as it should). Better example:
blockMesh -case $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity -dict ./system/topoSetDict
No opinion about the expansion.
- Maintainer
For me:
- if
-case
specified all paths should be local to the case path - if not using
-case
assume path is local to CWD
For both - still use leading
/
to bypassBy Andrew Heather on 2017-07-07T14:39:02 (imported from GitLab project)
- if
- Maintainer
Made the changes, but fails with parallel since we have things like
../constant/polyMesh/
which triggers the mechanism -> Error.At the moment, it looks best (safest) to continue with things being relative to the case. If we need to cover special things, can still always
-dict $PWD/../../other/path/dictName
- Mark OLESEN mentioned in commit b91bff64443fc6e6903b1648fa99d47c70f21b4e
mentioned in commit b91bff64443fc6e6903b1648fa99d47c70f21b4e
- Maintainer
Using the restyled IOobject (commit b91bff64), the following snippet reflected the attempted (and failed) logic: https://develop.openfoam.com/snippets/5
It seems that even if we add in some additional logic, it should normally only be activated by the IOobject constructor with the
fileName
parameter. However, the information doesn't persist, which means that later checks are easily confused between-dict ../some/path
which is external to the case and a normal../constant/polyMesh
for parallel. - Developer
please keep tab on #402 (closed)
- Maintainer
Could also just add
path.toAbsolute()
within IOobject::fileNameComponents - Author Maintainer
Seems logical. If you use the construct-from-fileName we apply filesystem conventions (so relative w.r.t. cwd). Construct-from-components still uses the relative w.r.t. case as before. Let's try.
- Mattijs Janssens mentioned in commit a77b501e940b6ee5e5752a1ca990257ad6cbccb0
mentioned in commit a77b501e940b6ee5e5752a1ca990257ad6cbccb0
- Maintainer
Looks like that change fails horribly for cases using the
-region
option (eg, externalSolarLoad). I vote for reverting this commit and leaving everything as it was. Optionally, we could add in special logic whereby only having a leading./
or../
would trigger the behaviour. For example,fileName path(rawPath); if (path.startsWith("./") || path.startsWith("../")) { path.toAbsolute(); }
This would allow a distinction between
-dict ./mylocalDict
and the current-dict system/someDict
. It would also be more consistent with what the fileName expand() is currently doing for such input. - Maintainer
Agreed
By Andrew Heather on 2017-07-18T10:03:28 (imported from GitLab project)
- Developer
multiRegionHeaterRadiation from chtMultiRegionSimpleFoam
This fails in develop and works with following change
- faceAgglomerate -region $i -dict constant/
$i
/viewFactorsDict
- faceAgglomerate -region $i -dict constant/
- Author Maintainer
feel free to revert.
- Mark OLESEN mentioned in commit 790b7ef4cdd235c843a2df5023897c8d9b8e922a
mentioned in commit 790b7ef4cdd235c843a2df5023897c8d9b8e922a
- Mark OLESEN closed
closed