Skip to content

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

@jtratner

Description

@jtratner

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions