directory

NAnt - how to get the directory path of the included script

99封情书 提交于 2019-12-24 05:14:10
问题 I have a common NAnt script (containing some common targets and constants) that I include in many other NAnt scripts like this: <include buildfile="<path>\common.build" verbose="true" /> Calling scripts are in various folders. In this included script I need to read a file from the same directory, where included script resides. "Current directory" is set to the directory of the calling script, not included one. How can I get the directory path of the included script? If I use the following

Using OpenFileDialog w/ a relative path as initialDirectory

折月煮酒 提交于 2019-12-24 04:34:06
问题 I'd like to give the appropriate value to Initial directory, so it would open the folder (called "Images") which I created in my project. I must use a relative path, so my program works not depending on the computer I work . But the problem is I don't know how to access this folder... Does anyone know how to solve this problem? 回答1: use: openFileDialog.InitialDirectory = Path.Combine(Application.StartupPath, @"YourSubDirectoryName"); Edit: or try this if you prefer... are you in windows forms

opendir will not accept string variable but will accept plain string

扶醉桌前 提交于 2019-12-24 04:08:15
问题 I cannot get this function to work, because for some reason opendir will not take buffer2 (declared as char buffer2[128]) as an argument properly. If I replace the variable with something like "." or "sample", it works perfectly. But doing it like this, I get a segmentation fault every time. Please help. system("clear"); DIR *dirp; struct dirent *dp; printf("Enter directory name: "); fgets(buffer2, 100, stdin); if((dirp = opendir(buffer2)) == NULL) printf("Could not open directory\n"); while(

how to list all files names under a folder in hard drive?

梦想与她 提交于 2019-12-24 03:58:05
问题 I want to list all files names exist under folder in hard drive with vb.net , and i don't know how.First ,i choose a folder with folderbrowser component, next,i list all files Here is my code (only for choose a folder) dossier_disque.ShowDialog() txt_folder.Text = dossier_disque.SelectedPath for list all files , i tried to use for each , but it's not correct my code when i tried to list file Dim files() As String = Directory.GetFiles(txt_folder.Text) For Each a In CStr(files.Count) folder

Drag and drop in listview C# [duplicate]

故事扮演 提交于 2019-12-24 03:48:15
问题 This question already has an answer here : Drag and drop listview C# (1 answer) Closed 6 years ago . I currently trying to have my program able to drag a file and and drop it into the listview. I have see many sample and most of them have the following code: private void listView1_draganddrop(object sender, DragEventArgs e) However after I implmeneted those code I have the few error i encounter..first is there no overload for listview1_SelectedIndexChanged match delegate System event handler

Class not found PHP

爱⌒轻易说出口 提交于 2019-12-24 03:21:14
问题 I used THIS twitter librabry and getting this error. Can anyone tell where i am going wrong ? ERROR Fatal error: Class 'Abraham\TwitterOAuth\Config' not found in D:\wamp\www\Abraham\TwitterOAuth\TwitterOAuth.php on line 17 PHP <?php require_once("Abraham/TwitterOAuth/TwitterOAuth.php"); //Path to twitteroauth library you downloaded in step 3 //keys and tokens initialised function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) { $connection = new

How delete folders created by yeoman in Windows?

血红的双手。 提交于 2019-12-24 03:20:38
问题 Following this guide, after execute the command yo webapp a folder named node_modules is created. I want to delete that folder but I can't do it neither using command line or Windows file explorer because the path is too long. How I can delete this folder? Error message at console: rmdir : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. 回答1: Specify the path using

How delete folders created by yeoman in Windows?

▼魔方 西西 提交于 2019-12-24 03:20:09
问题 Following this guide, after execute the command yo webapp a folder named node_modules is created. I want to delete that folder but I can't do it neither using command line or Windows file explorer because the path is too long. How I can delete this folder? Error message at console: rmdir : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. 回答1: Specify the path using

Delete all files inside a folder but the last?

主宰稳场 提交于 2019-12-24 02:40:15
问题 I'm looking for a script to loop through a folder and delete all the files inside it but the last, most recent one ( I have marked the name of each file as filename_date('Y')_date('m')_date('d').extension) , not sure if relevant ). I have found this script here on stack: if ($handle = opendir('/path/to/your/folder')) { $files = array(); while (false !== ($file = readdir($handle))) { if (!is_dir($file)) { // You'll want to check the return value here rather than just blindly adding to the

List files in folder which match pattern

醉酒当歌 提交于 2019-12-24 02:26:04
问题 I need to list files in directory which match some pattern. I tried playing with Directory.GetFiles , but don't fully get why it behaves in some way. 1) For example, this code: string[] dirs = Directory.GetFiles(@"c:\test\", "*t"); foreach (string dir in dirs) { Debugger.Log(0, "", dir); Debugger.Log(0, "", "\n"); } outputs this: c:\test\11.11.2007.txtGif c:\test\12.1.1990.txt c:\test\2.tGift c:\test\2.txtGif c:\test\test.txt ...others hidden You can see some files end with f but were still