Questions that relate to the organization of files and directories in a filesystem.
Questions tagged [directory-structure]
1677 questions
1018
votes
12 answers
mkdir -p functionality in Python
Is there a way to get functionality similar to mkdir -p on the shell from within Python. I am looking for a solution other than a system call. I am sure the code is less than 20 lines, and I am wondering if someone has already written it?

Setjmp
- 27,279
- 27
- 74
- 92
940
votes
8 answers
What is the best project structure for a Python application?
Imagine that you want to develop a non-trivial end-user desktop (not web) application in Python. What is the best way to structure the project's folder hierarchy?
Desirable features are ease of maintenance, IDE-friendliness, suitability for source…

kbluck
- 11,530
- 4
- 25
- 25
404
votes
12 answers
Print Directory & File Structure with icons for representation in Markdown
I want a Linux command to print directory & file structures in the form of a tree, possibly with Unicode icons before each file, and some hint for the best syntax to include the output in a Markdown document, without spaces between…

Matt Rowles
- 7,721
- 18
- 55
- 88
256
votes
6 answers
Best practice for Django project working directory structure
I know there is actually no single right way. However I've found that it's hard to create a directory structure that works well and remain clean for every developer and administrator. There is some standard structure in most projects on github. But…

raacer
- 5,302
- 3
- 27
- 46
247
votes
4 answers
OO Design in Rails: Where to put stuff
I'm really enjoying Rails (even though I'm generally RESTless), and I enjoy Ruby being very OO. Still, the tendency to make huge ActiveRecord subclasses and huge controllers is quite natural (even if you do use a controller per resource). If you…

Dan Rosenstark
- 68,471
- 58
- 283
- 421
180
votes
18 answers
List directory tree structure in python?
I know that we can use os.walk() to list all sub-directories or all files in a directory. However, I would like to list the full directory tree content:
- Subdirectory 1:
- file11
- file12
- Sub-sub-directory 11:
- file111
…

cinny
- 2,292
- 3
- 18
- 23
158
votes
5 answers
mkdir's "-p" option
So this doesn't seem like a terribly complicated question I have, but it's one I can't find the answer to. I'm confused about what the -p option does in Unix. I used it for a lab assignment while creating a subdirectory and then another…

user3476866
- 1,589
- 2
- 10
- 3
136
votes
10 answers
How to specify the JDK version in Android Studio?
Android Studio is giving me a Gradle build error that looks like this:
Error:(3, 22) compileSdkVersion android-22 requires compiling with JDK 7
Now it gives me these clickable prompts:
Download JDK 7
Select a JDK from the File System
Open…

ThePartyTurtle
- 2,276
- 2
- 18
- 32
125
votes
12 answers
How to [recursively] Zip a directory in PHP?
Directory is something like:
home/
file1.html
file2.html
Another_Dir/
file8.html
Sub_Dir/
file19.html
I am using the same PHP Zip class used in PHPMyAdmin…

ed209
- 11,075
- 19
- 66
- 82
98
votes
10 answers
Java: How can I compile an entire directory structure of code ?
The use case is simple. I got the source files that were created using Eclipse. So, there is a deep directory structure, where any Java class could be referring to another Java class in the same, child, sibling or parent folder.
How do I compile…

euphoria83
- 14,768
- 17
- 63
- 73
96
votes
2 answers
Unix standard directory to put custom executables or scripts?
If I have a custom shell script or program that I created myself or downloaded from the web and I want to be able to execute this from the CLI, is there the standard location to put this in Linux/Unix directory structure?
/usr/bin ?
/usr/local/bin…

atedja
- 1,436
- 2
- 11
- 13
96
votes
5 answers
Directory structure for a C++ library
I am working on a C++ library. Ultimately, I would like to make it publicly available for multiple platforms (Linux and Windows at least), along with some examples and Python bindings. Work is progressing nicely, but at the moment the project is…

TC.
- 4,133
- 3
- 31
- 33
79
votes
1 answer
Python relative-import script two levels up
I've been struggling with imports in my package for the last hour.
I've got a directory structure like so:
main_package
|
| __init__.py
| folder_1
| | __init__.py
| | folder_2
| | | __init__.py
| | | script_a.py
| | | script_b.py
|
…

Luke Taylor
- 8,631
- 8
- 54
- 92
69
votes
2 answers
Where do I put my python files in the venv folder?
(Probably a noob question, but I didn't find a solution after googling for 20 minutes.)
I created a new pure Python project with PyCharm which yielded the following folder structure
myproject
└── venv
├── bin
│ ├── activate
│ ├──…

problemofficer - n.f. Monica
- 2,000
- 3
- 20
- 35
56
votes
2 answers
What does double slash // in `cd //` mean in Linux?
I've entered a command cd // instead of cd / by mistake and instead of getting an error as I'd expect the shell (Bash) showed a prompt as if I'm in the // directory:-
@://$
@://$ pwd
//
Listing the content of…

vitaut
- 49,672
- 25
- 199
- 336