Skip to content
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

Different behavior with non-existent target directories in POSIX vs. OBS #48

Open
jtratner opened this issue Oct 2, 2017 · 2 comments

Comments

@jtratner
Copy link
Contributor

jtratner commented Oct 2, 2017

I was looking into consolidating tests and I realized that this test has different behavior on swift vs. local filesystem. Specifically, if you use copytree or copy or open, parent directories are auto-created on OBS but not on POSIX:

        folder = stor.join(container, 'analysis')
        subfolder = stor.join(container, 'analysis', 'alignments')
        file_in_folder = stor.join(container, 'analysis', 'alignments',
                                   'bam.bam')
        self.assertFalse(stor.exists(file_in_folder))
        self.assertFalse(stor.isdir(folder))
        self.assertFalse(stor.isdir(folder + '/'))
        with stor.open(file_with_prefix, 'w') as fp:
            fp.write('data\n')
        self.assertFalse(stor.isdir(folder))
        self.assertTrue(stor.isfile(file_with_prefix))

If we wanted to actually have cross-compatible behavior, I'm thinking we should make an API break and then have open(), copy(), copytree() all create parent directories for you (again, to provide consistency).

Thoughts @pkaleta @kyleabeauchamp @wesleykendall ?

@jtratner
Copy link
Contributor Author

jtratner commented Oct 2, 2017

Similarly, might be nice to support use_manifest=True in copytree for POSIX paths as well - so you don't have to think about the behavior whatsoever.

@jtratner
Copy link
Contributor Author

jtratner commented Oct 2, 2017

turns out copytree already handles this, so it's just adding support for copy() and open()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant