Skip to content

Remove recursive scanning of backup file #2

Open
@kwikadi

Description

@kwikadi

set topdown=False inside os.walk., at least till you replace it with scandir (which looks pretty neat, might steal that idea)

Activity

dufferzafar

dufferzafar commented on Jan 3, 2015

@dufferzafar
Owner

I don't really get what you mean by "recursive scanning of backup file".

Also, If we set topdown=False we won't be able to ignore the directories (See this).

kwikadi

kwikadi commented on Jan 3, 2015

@kwikadi
Author

A very poor implementation would require you to scan the backup folder after backing up the entire drive, and removing offending folders.
Cant think of anything else right now. If I do, I'll let you know?

dufferzafar

dufferzafar commented on Jan 4, 2015

@dufferzafar
Owner

We're just trying to fix the bug that destination can't be a child of the source directory (while keeping the rest of the functionality of the script as is) right? because if that's the case I've thought of something. Too lazy to implement it though.

kwikadi

kwikadi commented on Jan 4, 2015

@kwikadi
Author

Huh. What is it?

dufferzafar

dufferzafar commented on Jan 4, 2015

@dufferzafar
Owner

We just store all the directories in source and then walk over every one of them?

children = os.listdir(src_root)

for child in children:
    for cur_dir, dirs, files in os.walk(os.path.join(src_root, child)):
        ... rest of the code same ...
dufferzafar

dufferzafar commented on Jan 4, 2015

@dufferzafar
Owner

Now that I've written it, I can see that this is only a partial solution and won't work in all cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dufferzafar@kwikadi

        Issue actions

          Remove recursive scanning of backup file · Issue #2 · dufferzafar/Python-Scripts