directory

composer报错解决

强颜欢笑 提交于 2019-12-17 06:32:39
Cannot create cache directory /home/ubuntu/.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache 权限报错 sudo chown -R $USER ~/.composer/ Cannot create cache directory /home/ubuntu/.composer/cache/files/, or directory is not writable. Proceeding without cache 也是权限问题 sudo chmod -R 777 /home/ubuntu/.composer/cache/files/ 来源: CSDN 作者: 絮絮叨叨的口刀 链接: https://blog.csdn.net/qq_41851315/article/details/103565053

How do I get a list of files in a directory in C++?

匆匆过客 提交于 2019-12-17 06:28:34
问题 How do you get a list of files within a directory so each can be processed? 回答1: But boost::filesystem can do that: http://www.boost.org/doc/libs/1_37_0/libs/filesystem/example/simple_ls.cpp 回答2: Here's what I use: /* Returns a list of files in a directory (except the ones that begin with a dot) */ void GetFilesInDirectory(std::vector<string> &out, const string &directory) { #ifdef WINDOWS HANDLE dir; WIN32_FIND_DATA file_data; if ((dir = FindFirstFile((directory + "/*").c_str(), &file_data))

Iterating through directories with Python

和自甴很熟 提交于 2019-12-17 06:22:02
问题 I need to iterate through the subdirectories of a given directory and search for files. If I get a file I have to open it and change the content and replace it with my own lines. I tried this: import os rootdir ='C:/Users/sid/Desktop/test' for subdir, dirs, files in os.walk(rootdir): for file in files: f=open(file,'r') lines=f.readlines() f.close() f=open(file,'w') for line in lines: newline = "No you are not" f.write(newline) f.close() but I am getting an error. What am I doing wrong? 回答1:

How can I exclude multiple folders using Get-ChildItem -exclude?

大兔子大兔子 提交于 2019-12-17 06:06:14
问题 I need to generate a configuration file for our Pro/Engineer CAD system. I need a recursive list of the folders from a particular drive on our server. However I need to EXCLUDE any folder with 'ARCHIVE' in it including the various different cases. I've written the following which works except it doesn't exclude the folders !! $folder = "T:\Drawings\Design\*" $raw_txt = "T:\Design Projects\Design_Admin\PowerShell\raw.txt" $search_pro = "T:\Design Projects\Design_Admin\PowerShell\search.pro"

Directory.GetFiles of certain extension

情到浓时终转凉″ 提交于 2019-12-17 05:53:44
问题 Is there a way to simplify this linq expression, or is there a better way of doing this? Directory.GetFiles(dir, "*.*", SearchOption.AllDirectories) .Where(s => s.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase) || s.EndsWith(".gif", StringComparison.OrdinalIgnoreCase) || s.EndsWith(".png", StringComparison.OrdinalIgnoreCase) || ...); Basically I want to return all files of a certain extension. Unfortunately, this method isn't very flexible. I'd rather be able to add extensions to a list

Git ignore sub folders

风格不统一 提交于 2019-12-17 05:16:09
问题 I have a lot of projects in my .Net solution. I would like to exclude all "bin/Debug" and "bin/Release" folders (and their contents), but still include the "bin" folder itself and any dll's contained therein. .gitignore with "bin/" ignores "Debug" and "Release" folders, but also any dll's contained in the "bin" folder. "bin/Debug" or "bin/Release" in the .gitignore file does not exclude the directories, unless I fully qualify the ignore pattern as "Solution/Project/bin/Debug" - which I don't

PHP recursive directory path

廉价感情. 提交于 2019-12-17 05:11:23
问题 i have this function to return the full directory tree : function getDirectory( $path = '.', $level = 0 ){ $ignore = array( 'cgi-bin', '.', '..' ); // Directories to ignore when listing output. Many hosts // will deny PHP access to the cgi-bin. $dh = @opendir( $path ); // Open the directory to the handle $dh while( false !== ( $file = readdir( $dh ) ) ){ // Loop through the directory if( !in_array( $file, $ignore ) ){ // Check that this file is not to be ignored $spaces = str_repeat( ' ', (

How to get files in a relative path in C#

▼魔方 西西 提交于 2019-12-17 05:03:40
问题 If I have an executable called app.exe which is what I am coding in C#, how would I get files from a folder loaded in the same directory as the app.exe, using relative paths? This throws an illegal characters in path exception: string [ ] files = Directory.GetFiles ( "\\Archive\\*.zip" ); How would one do this in C#? 回答1: To make sure you have the application's path (and not just the current directory), use this: http://msdn.microsoft.com/en-us/library/system.diagnostics.process

What are the ways to make an html link open a folder

谁说胖子不能爱 提交于 2019-12-17 04:22:18
问题 I need to let users of an application open a folder by clicking a link inside a web page. The path of the folder is on the network and can be accessed from everywhere. I'm probably sure there is no easy way to do this, but maybe I'm mistaken? 回答1: Do you want to open a shared folder in Windows Explorer? You need to use a file: link, but there are caveats: Internet Explorer will work if the link is a converted UNC path ( file://server/share/folder/ ). Firefox will work if the link is in its

how to zip a folder itself using java

落爺英雄遲暮 提交于 2019-12-17 03:52:06
问题 Suppose I have the following directory structure. D:\reports\january\ Inside january there are suppose two excel files say A.xls and B.xls. There are many places where it has been written about how to zip files using java.util.zip . But I want to zip the january folder itself inside reports folder so that both january and january.zip will be present inside reports. ( That means when I unzip the january.zip file I should get the january folder ). Can anyone please provide me the code to do