subdirectory

List folders and files in a UNC root folder

让人想犯罪 __ 提交于 2019-12-23 02:53:22
问题 I am trying to get folders and files from the root of a UNC path name. I am using Get-ChildItem . I can get results from a subfolder via the UNC path, but not the root folder. If run the command Get-ChildItem \\sf1\user1 from the command line, results are returned. Directory: \\sf1\user1 Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 11/14/2013 3:40 PM 1.ISGROUP When I try to execute Get-ChildItem \\sf1 from the command line I get errors. Get-ChildItem : Cannot find path

openbase_dir and subdirectories

北战南征 提交于 2019-12-22 19:12:08
问题 i will have numerous subdirectories eg. /home/a, /home/a/file, /home/a/txt, /home/b, /home/b/file, /home/b/txt, etc. the subdirectories are created on demand. i need to add all subdirectories to open_basedir. pls advise how to make open_basedir recognise all subdirectories of a top path? 回答1: From http://php.net/manual/en/ini.core.php#ini.open-basedir The restriction specified with open_basedir is a directory name since PHP 5.2.16 and 5.3.4. Previous versions used it as a prefix. This means

Python importing subdirectories

你说的曾经没有我的故事 提交于 2019-12-22 18:27:36
问题 I'm trying to import all files from a sub-directory, so I figured I could write __init__.py in that sub-directory to import the files. However, when I do this it does not seem to import anything. File structure: prog.py module/ __init__.py code.py Code for prog.py : pass Code for __init__.py : import code Code for code.py : print('hello') When I run prog.py nothing happens. Why does it not print hello , and is there a better way to easily import everything from a sub-directory? 回答1: Put this

Read all files in directory sub folders

若如初见. 提交于 2019-12-22 10:21:37
问题 I have a folder - "C:\scripts" Within "scripts" I have several sub folders e.g. - "C:\scripts\subfolder1" "C:\scripts\subfolder2" etc, that contain html files. I am trying to use the following code - foreach (string file in Directory.EnumerateFiles(@"C:\scripts","*.html")) { string contents = File.ReadAllText(file); } However this does not work due to the html files being in the sub folders. How can I access the html files in the sub folders without having to manually put in the path of each

Mapping a secondary domain to a subdirectory using mod_rewrite

主宰稳场 提交于 2019-12-21 20:49:40
问题 I am looking to map a secondary domain to a subfolder on my document root. For example, if requests to the domain www.example.com map to my DocumentToot, then requests to www.exampletwo.com go to /sites/files/ . I am unable to accomplish a redirect from www.exampletwo.com/index.html to www.exampletwo.com/sites/files/index.html while making the URL still display www.exampletwo.com/index.html . Any ideas? 回答1: I believe you're looking for something like this: RewriteCond %{HTTP_HOST} ^(www\.)

How can I tell, within a CMakeLists.txt, whether it's used with add_subdirectory()? [duplicate]

有些话、适合烂在心里 提交于 2019-12-21 19:53:32
问题 This question already has answers here : How to detect if current scope has a parent in CMake? (2 answers) Closed last year . I have this code project can be built either independently or as a subproject of a larger repository (checking it our as a sub-repository). In the latter case, I have a top-level CMakeLists.txt for the main project which has add_subdirectory(${MY_SUBPROJ_SUBDIR}) now, I want the subproject to behave somewhat differently in case it's used via the add_directory() .

python read all files in directory and subdirectories

强颜欢笑 提交于 2019-12-21 10:35:40
问题 I'm trying to translate this bash line in python: find /usr/share/applications/ -name "*.desktop" -exec grep -il "player" {} \; | sort | while IFS=$'\n' read APPLI ; do grep -ilqw "video" "$APPLI" && echo "$APPLI" ; done | while IFS=$'\n' read APPLI ; do grep -iql "nodisplay=true" "$APPLI" || echo "$(basename "${APPLI%.*}")" ; done The result is to show all the videos apps installed in a Ubuntu system. -> read all the .desktop files in /usr/share/applications/ directory -> filter the strings

python read all files in directory and subdirectories

ぐ巨炮叔叔 提交于 2019-12-21 10:35:10
问题 I'm trying to translate this bash line in python: find /usr/share/applications/ -name "*.desktop" -exec grep -il "player" {} \; | sort | while IFS=$'\n' read APPLI ; do grep -ilqw "video" "$APPLI" && echo "$APPLI" ; done | while IFS=$'\n' read APPLI ; do grep -iql "nodisplay=true" "$APPLI" || echo "$(basename "${APPLI%.*}")" ; done The result is to show all the videos apps installed in a Ubuntu system. -> read all the .desktop files in /usr/share/applications/ directory -> filter the strings

python read all files in directory and subdirectories

独自空忆成欢 提交于 2019-12-21 10:34:03
问题 I'm trying to translate this bash line in python: find /usr/share/applications/ -name "*.desktop" -exec grep -il "player" {} \; | sort | while IFS=$'\n' read APPLI ; do grep -ilqw "video" "$APPLI" && echo "$APPLI" ; done | while IFS=$'\n' read APPLI ; do grep -iql "nodisplay=true" "$APPLI" || echo "$(basename "${APPLI%.*}")" ; done The result is to show all the videos apps installed in a Ubuntu system. -> read all the .desktop files in /usr/share/applications/ directory -> filter the strings

install multiple Laravel 4 projects to sub directories

心已入冬 提交于 2019-12-20 16:21:32
问题 I'm trying to upload multiple Laravel 4 projects to my web server, not my development server. Each laravel 4 app is housed in their own subdirectory. How should my file structure be? I've searched around for a htaccess to remove the /public from the url but i've been unsuccessful. this server is for testing purposes only, it allows others to follow along as the project is being built. I know their are major security issues with leaving the laravel base structure in these directories, but