-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vsimem: Implicitly create parent directories when creating a file #8369
Conversation
The test failure in
now creates a directory |
fix for that and similar (hidden) issues in dbaston#1 I basically grepped "/vsimem/" in the code base an looked for "/vsimem/foo/..." type of filenames . In most cases a simple replacement from "/vsimem/foo/bar" to "/vsimem/foo_bar" does it (for single files). A few particular cases for the GMLJP2 stuff and the WFS driver that actually did a RmdirRecursive(). In some cases anonymous vsimem files could also be created to simplify things |
@dbaston It could be appropriate to add a note in MIGRATION_GUIDE.TXT to describe the new behaviour of /vsimem/ . It could cause some issues for external code doing |
Actually I'm wondering if GDAL drivers & components shouldn't write in a /vsimem/gdal/ directory to limit polluting the user /vsimem/ space (possibly with a special behaviour of ReadDir("/vsimem/") hidding the "_gdal" subdirectory ?), and autotest could check that the content of /vsimem/gdal/ is empty when tests have tear down, to detect failure of GDAL code to clean after itself |
975e102
to
9a69968
Compare
So it appears that all necessary test adjustments have been made, but:
Is it worth consolidating on a single strategy here? As much as I'd like to be done here, it seems worth raising 😅. I think #3 is the only strategy that can work for all drivers. |
yes, could be nice to consolidate that on that. And potentially remove /vsimem/ special processing in CPLHTTPFetchEx() (but we might use that in other tests) and int PLScenes driver that was done only for tests. |
Of course, this is more complicated than I envisioned -- for ElasticSearch, we need to correctly handle different HTTP verbs (vsimem |
/vsis3/ deals with different HTTP verbs
Both approaches have their advantages:
|
1d0f874
to
0205fec
Compare
bdcc820
to
9abf1d4
Compare
@dbaston Is it still WIP ? |
…vsimem/foo file and /vsimem/foo/ directory
…d_compressor A .metadata file is created after the cleanup block in this test and is present when the test runs for a second time with format="ZARR_V3".
… /vsimem/foo/ directory
db09285
to
bc566c5
Compare
bc566c5
to
6754d5a
Compare
I think it can be considered ready. |
What does this PR do?
Resolves #8232 by implicitly creating parent directories when needed. A side-effect is that it is no longer possible to have a a file
/vsimem/foo
and a file/vsimem/foo/baz
. Some test updates are included to accommodate this.What are related issues/pull requests?
#8232
Tasklist