directory

error in makefile

时光怂恿深爱的人放手 提交于 2019-12-23 16:45:46
问题 I am using gnu Make 3.82 and have an annoying problem. I have a rule setting dependencies between directories. OBJDIR=../obj $(objdir)/%.o: %.C $(COMPILE) -MM -MT$(objdir)/$(notdir $@) $< -o $(DEPDIR)/$(notdir $(basename $<).d ) $(COMPILE) -o $(objdir)/$(notdir $@ ) -c $< In order to do this, the obj directory must exist. I want to mkdir the directory as a prerequisite $(objdir)/%.o: %.C $(objdir) $(COMPILE) -MM -MT$(objdir)/$(notdir $@) $< -o $(DEPDIR)/$(notdir $(basename $<).d ) $(COMPILE)

Is there an easy way to read filenames in a directory and add to an array?

回眸只為那壹抹淺笑 提交于 2019-12-23 16:34:39
问题 I have a directory: Audio/ and in that will be mp3 files only. I'm wanting to automate the process of creating links to those files. Is there a way to read a directory and add filenames within that directory to an array? It'd be doubly cool if we could do an associative array, and have the key be the file name minus the .mp3 tag. Any ideas? To elaborate: I actual have several Audio/ folders and each folder contains mp3s of a different event. The event details are being pulled from a database

PHP script to automatically create file structure representation [duplicate]

痴心易碎 提交于 2019-12-23 13:32:55
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: PHP - Iterate through folders and display HTML contents Using PHP, I'm trying to create a script that will navigate to the root directory of a website, and from there, using scandir() or glob() (those being the only directory scanning functions I've learned), I would use a recursive method to navigate through all the items in the root directory, then re-calling itself when encountering an entry that tested to

Use multiple file extensions for glob to find files

社会主义新天地 提交于 2019-12-23 13:15:23
问题 I am using glob to list out all my python files in the home directory by this line of code. I want to find all .json files too along with py files, but I couldn't found any to scan for multiple file types in one line code. for file in glob.glob('/home/mohan/**/*.py', recursive=True): print(file) 回答1: You could use os.walk, which looks in subdirectories as well. import os for root, dirs, files in os.walk("path/to/directory"): for file in files: if file.endswith((".py", ".json")): # The arg can

Give no one access in a directory .htaccess

帅比萌擦擦* 提交于 2019-12-23 13:09:24
问题 It is probably very simple but I can't find it. I want to make a .htaccess file so no one can get into the folder. except for the php on the server. does anyone know the code line? Thanks Matthy 回答1: You want Deny from all 回答2: Instead of denying all traffic you could try redirecting it with mod_rewrite to make it useful i.e. back into the flow of the site. RewriteEngine on rewriteRule ^path/to/forbidden/directory/? index.php [L] 回答3: Maybe it's better to change the rights and ownerships of

Compute number of files per folder in a complex folder structure?

烂漫一生 提交于 2019-12-23 12:55:08
问题 I have created a simple data.tree through importing a folder structure with files inside of it. if (!require("pacman")) install.packages("pacman") pacman::p_load_gh("trinker/pathr") library(pathr) library(data.tree) folder_structure <- pathr::tree(path = "/Users/username/Downloads/top_level/", use.data.tree = T, include.files = T) Now, I would like to convert the object folder_structure into a data.frame with one row per folder and a column that specifies how many files each folder contains.

Display Images From A Folder (slideshow)

怎甘沉沦 提交于 2019-12-23 12:46:44
问题 I have been trying to google and find out how to make a .php script that will make a an automatic slideshow of images from a folder, I've only managed to get the pictures to automatically show up on the php page, but I can't figure out how to make them slide one by one, like a slideshow. Here is the url to the page where the images show up, so you can have a look Here is the code I've used. <? $files = glob("images/*.*"); for ($i=0; $i<count($files); $i++) { $num = $files[$i]; echo '<img src=

Creating a directory on remote FTP using powershell

爷,独闯天下 提交于 2019-12-23 10:58:51
问题 I"m able to put a file up to a remote FTP with a modified version of... $File = "D:\Dev\somefilename.zip" $ftp = "ftp://username:password@example.com/pub/incoming/somefilename.zip" "ftp url: $ftp" $webclient = New-Object System.Net.WebClient $uri = New-Object System.Uri($ftp) "Uploading $File..." $webclient.UploadFile($uri, $File) I'm running into the problem that I"m trying to upload a file to a directory that doesn't exist, the put fails. So I need to create the target directory first. GET

Python Import class in __init__.py from file in same package

只谈情不闲聊 提交于 2019-12-23 10:19:13
问题 I feel like I should know this, having programmed in Python for as long as I have, but I'm constantly learning new things about the fine lanuaguge. The question I have (which may very well be a duplicate, however I haven't been able to find this same case) is this. I have a file layout like this: websocket/ __init__.py client.py server.py How can I import classes that are in the file __init__.py from client.py or server.py ? Nice and simple :P Thanks in advance! My question isn't a duplicate

Data structure to store a directory structure ?

[亡魂溺海] 提交于 2019-12-23 10:17:35
问题 I am developing a simple java web application using struts 2 framework. the purpose of the application is to display a specific directory structure under my computer using a JSP page. My question is which data structure to use in order to store a directory structure, so that the JSP page can access that directory structure object from the action class. ps:I want to use the following java code to traverse the directory. Plz help import java.io.File; public class DisplayDirectoryAndFile{ public