openframeworks / openframeworks/openFrameworks

ofDirectory::removeDirectory

Open
#1,561 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

code-review core prelim-analysis section-internals
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

This is just an unfortunate arg ordering.

All other ofFile / ofDirectory methods have bRelativeToData = true as the second arg.
with removeDirectory the second arg is deleteIfEmpty - so it might be easy to be confused with the others and have people accidentally.

https://github.com/openframeworks/openFrameworks/blob/develop/libs/openFrameworks/utils/ofFileUtils.h#L272

ps: not sure what the best fix is here.
anything to do with deleting files should be handled with care.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ofDirectory::removeDirectory in libs/openFrameworks/utils/ofFileUtils.h around line 272, and compare its argument order with the other ofFile and ofDirectory methods. Determine a safe API change that avoids confusing deleteIfEmpty with bRelativeToData while accounting for the care required by deletion operations. Done means the argument ordering concern has a clearly defined, reviewed resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.