directory

i have got this code of MSDN but still can't get my program to work with it

♀尐吖头ヾ 提交于 2019-12-25 14:00:18
问题 I can copy all the files from multiple directory's but what I want to do is copy all of the directory's with the files inside them as they are where I am copying the from and not putting just the files in my target folder. Here is my code so far { string SelectedPath = (string)e.Argument; string sourceDirName; string destDirName; bool copySubDirs; DirectoryCopy(".", SelectedPath, true); DirectoryInfo dir = new DirectoryInfo(sourceDirName); DirectoryInfo[] dirs = dir.GetDirectories(); // If

How to extract file path from an audio file stored in project resource folder in C#

徘徊边缘 提交于 2019-12-25 12:37:12
问题 I am having a problem extracting the file directory of an audio file which is stored in my project resource folder. In my project, I have a mysounds.resx file in which I added a file (abc.mp3). WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer(); wplayer.URL = "E:/xyz.mp3"; wplayer.settings.setMode("loop",false); wplayer.controls.play(); Here, when I give the "E:/xyz.mp3" directory in wplayer.URL, it plays fine. But what I want to do is to get the file path from mysounds.resx

using 'glob' to get all images from a directory

一笑奈何 提交于 2019-12-25 12:11:06
问题 I'm trying to get all images from a directory and print them. I know my URL is correct because I am echoing the the $dirname along with a .jpg image I have saved in the directory. What am I doing wrong? <?php $dirname = "uploads/{$site_country}_{$site_state}_{$site_name}/{$record_id}/"; $images = glob($dirname . "*.jpg"); foreach($images as $image) { echo '<img src="'.$image.'"/>'; } //check to see if $dirname is correct echo '<img src="' . $dirname . "IMG_0002.JPG" . '"/>'; ?> //edit I have

Batch rename folders

无人久伴 提交于 2019-12-25 12:09:12
问题 I have about 2000 folders all named like this dataul_-_ppfsefs music_-_ppfsefs fun [gghhhses] pictures_-_ppfsefs backup [gghhhses] tempfiles_-_ppfsefs trash_it_-_ppfsefs There are two unwanted portion at the end of the name "_-_ppfsefs" and " [gghhhses]", How to I rename them to look like this dataul music fun pictures backup tempfiles trash_it Edit: I'm on Mac OSX (installed brew, macports). 回答1: The following two commands should do it: for dir in * ; do mv "${dir}" "${dir/_-_ppfsefs/}" ;

Changing path to parent directory of active working folder

蹲街弑〆低调 提交于 2019-12-25 11:55:04
问题 I have a code that is list files in directory. how can I address code to look into parent directory of current workbook directory? i want it to be independent wherever I place it. (first code addressing to the second one to read file from) Thanks. .... Application.ScreenUpdating = False ShowPDFs "C:\Test\Working\", ws ws.UsedRange.EntireColumn.AutoFit Application.ScreenUpdating = True End Sub ------------------------------ Private Sub ShowPDFs(ByRef fsoPath....... 回答1: Just check that the

Changing path to parent directory of active working folder

北城余情 提交于 2019-12-25 11:54:34
问题 I have a code that is list files in directory. how can I address code to look into parent directory of current workbook directory? i want it to be independent wherever I place it. (first code addressing to the second one to read file from) Thanks. .... Application.ScreenUpdating = False ShowPDFs "C:\Test\Working\", ws ws.UsedRange.EntireColumn.AutoFit Application.ScreenUpdating = True End Sub ------------------------------ Private Sub ShowPDFs(ByRef fsoPath....... 回答1: Just check that the

Foreach bitmap in folder

我们两清 提交于 2019-12-25 10:55:12
问题 So below is some code that uses TessNet's OCR tool to scans each bitmap in the folder and processes the OCR information into List<tessnet2.Word> result . But I can't seem to get the foreach to work right. I get the following error foreach statement cannot operate on variables of type 'System.IO.DirectoryInfo' because 'System.IO.DirectoryInfo' does not contain a public definition for 'GetEnumerator' DirectoryInfo diBMP = new DirectoryInfo("c:\\temp\\bmps"); foreach (Bitmap bmp in diBMP) {

Put files automatically in folders

余生长醉 提交于 2019-12-25 10:54:23
问题 I have thousands of JPGs named like this "aaa0001.jpg, aaa0002.jpg, aaa0003.jpg, bbb0001.jpg, bbb0002.jpg, bbb0003.jpg, ccc0001.jpg, ccc0002.jpg, ccc0003.jpg etc." in one folder. I have created 26 folders like this aaa, bbb, ccc, ddd etc. Is it possible to create a script that sets all the images in the appropriate folder? Result "aaa0001.jpg, aaa0002.jpg, aaa0003.jpg" into folder "aaa", "bbb0001.jpg, bbb0002.jpg, bbb0003.jpg" into folder "bbb" etc. Thank you! My system is windows XP prof SP3

Can I install a Laravel project in a subdirectory of my server?

[亡魂溺海] 提交于 2019-12-25 08:59:59
问题 I have a website that was built with just good vanilla PHP, no frameworks, etc. I am now needed to add a blog to this website and I am wanting to use Laravel / Statamtic to do so. My question is this: Can I install a Laravel project in a subdirectory of my server? For example, www.mywebsite.com/blog/. Ideally, everything in the blog directory would operate with my Laravel code. Everything outside of the blog directory would just continue to work as is. Is this possible? And if it is possible,

Python script to test for most recently modified file - inconsistent results

孤人 提交于 2019-12-25 08:59:38
问题 I found this post on stackoverflow which was exactly what I wanted to integrate into a larger script I am writing: Find the newest folder in a directory in Python I want to check for the newest file or folder so modified the script for testing as follows: #!/usr/bin/env python3.1 import os def allFilesIn(b='.'): result = [] for d in os.listdir(b): bd = os.path.join(b, d) result.append(bd) return result latest_subdir = max(allFilesIn('/tmp/testforlatest'), key=os.path.getmtime) print(latest