Questions tagged [directory-tree]

43 questions
622
votes
27 answers

How to create a zip archive of a directory in Python?

How can I create a zip archive of a directory structure in Python?
Martha Yi
  • 6,347
  • 3
  • 16
  • 8
586
votes
20 answers

Directory-tree listing in Python

How do I get a list of all files (and directories) in a given directory in Python?
Matt
  • 72,111
  • 25
  • 51
  • 64
9
votes
3 answers

Representing a directory tree as a recursive list

I am stuck with a certain task. What I want is a function that, given a directory path, would return a recursive-list as an output. The output should be of the form myList$dir$subdir$subdir$fullFilePath So basically I want to represent a directory…
Karolis Koncevičius
  • 7,687
  • 9
  • 48
  • 71
8
votes
5 answers

How can I search my directory tree for contents within a file for a git managed project?

I like the unix find command but I always find it too 'fiddly' to use when I want to search through my project looking for a piece of text in any file in any directory or subdirectory. Is there an easier way to do this?
Michael Durrant
  • 84,444
  • 83
  • 284
  • 429
4
votes
1 answer

Netlify option to show directory contents

I need to list contents of my site directory on Netlify for debug, but I can not find an option to turn on directory listings. Am I right that there is no such autoindex ability in Netlify as mod_autoindex provides for Apache? UPDATE: I tried…
anatoly techtonik
  • 17,421
  • 8
  • 111
  • 131
3
votes
2 answers

Emacs dirtree - Directory tree view setup

I am very new to emacs, I am trying to get a directory tree. I have followed another StackOverFlow Emacs dirtree question and my .emacs and .emacs-d are as follows: .emacs ;; line number plugin (add-to-list 'load-path'…
user1152142
  • 839
  • 2
  • 12
  • 17
3
votes
2 answers

in bash find all files in flat directory that don't exist in another directory tree

I have many files in a directory A. Some of those files exist in a directory tree with sub-directories B/B1, B/B2, B/B3, B/B4, ... Note that some files have spaces in their names. For example: in directory A: there's a file named A/red…
martin jakubik
  • 4,118
  • 5
  • 26
  • 41
2
votes
2 answers

watching a directory tree whitout inotify

I'm trying to write a backup utility that is supposed to handle a rough 2 terrabytes of data in a lot of folders. I want it to perform actions on files when they get created/edited/deleted preferrably also file moves or renames. I've messed around…
blipman17
  • 523
  • 2
  • 20
2
votes
1 answer

Execute script once before installing a directory tree

I am trying to write an Inno Setup installer to install and then run other installers. The problem I have is when trying to install Cygwin. I have downloaded Cygwin and all packages I need so I can perform a local install. Then I want to add extra…
johno999
  • 23
  • 3
1
vote
1 answer

Get directory structure from FTP using PHP

I have ftp server with a lot of subfolders and files in it. I need to retrieve the folder structure from ftp, which shows names of all folders and subfolders from a specified starting path. I'm not interested in files included in each folder, only…
user2963789
  • 115
  • 2
  • 10
1
vote
1 answer

How can I create directory tree in C?

I want an easy way to create multiple directories in C. For example I want to create directory in: /a/b/c but if the directories are not there I want them to be created automagically. How can I do this ?
mcora
  • 43
  • 5
1
vote
0 answers

Use directory tree to display folders level by level on webpage based on user click

I have made a directory tree(i.e, a tree of the folders, it's subfolders and the subfolders' subfolders and so on) in my python file and I want to display that tree onto my webpage. So I send the tree to a HTML file.
1
vote
0 answers

Building a python script to create a tree of directory structure of SharePoint Document Library

Objective: To build a python script which will download all the files from a SharePoint Document Library and store in the same folder structure (including subfolders till the N-th) Using: Python 3.6 and a great SharePoint REST API tool by @Vadim…
Aakash Basu
  • 1,137
  • 2
  • 15
  • 39
1
vote
0 answers

Lazy iterator over files in directory structure

There are related questions, but none of them addresses the "lazy" part, that is, discover more content only as the iteration progresses. See How do I iterate through the files in a directory in Java? Also Apache Commons FileUtils.iterateFiles()…
joopRksn
  • 11
  • 2
1
vote
1 answer

How to determine whether files have been changed in a directory tree without traversing the entire tree?

Imagine a directory tree (on Linux): user@computer:~/demo> find…
s-m-e
  • 2,473
  • 2
  • 24
  • 52
1
2 3