directory

How to pass argument from Makefile to a program? [closed]

梦想与她 提交于 2021-01-28 07:33:19
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . Improve this question I want to pass directory of Makefile to a function. For example: Makefile $(DIR) = makefile directory program int main(int argc,char argv[]) char directory = argv[1] How can I do that? EDIT Clarificaion. I want my app to work outside of the directory that i compiled it in. 回答1

How to pass argument from Makefile to a program? [closed]

匆匆过客 提交于 2021-01-28 07:21:50
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . Improve this question I want to pass directory of Makefile to a function. For example: Makefile $(DIR) = makefile directory program int main(int argc,char argv[]) char directory = argv[1] How can I do that? EDIT Clarificaion. I want my app to work outside of the directory that i compiled it in. 回答1

Wix: CustomAction to set Folder permissions

故事扮演 提交于 2021-01-28 06:22:12
问题 We're using WiX to bundle up our ASP.NET code into an MSI installer, and we need to set the [ComputerName]\IIS_WPG group to have modify permissions on a folder (named "CO") under the installation directory. The directory structure looks like this after install C:\inetpub\wwwroot\MyApp\CO The CO folder is actually part of the .NET solution file, and when the application is bundled into an MSI, the CO folder is included automatically because there are XML files underneath it which are marked as

Getting UnauthorizedAccessException while counting the size of the directory

白昼怎懂夜的黑 提交于 2021-01-28 05:13:01
问题 I have a simple method that counts the size of the directory and all files within it. Here is the code: using System; using System.IO; namespace MyProject.Libs { public sealed class DirectorySize { public static long GetDirectorySize(DirectoryInfo dir) { long total = 0; FileInfo[] fileInfos = dir.GetFiles(); foreach (FileInfo fileInfo in fileInfos) { total += fileInfo.Length; } DirectoryInfo[] dirInfos = dir.GetDirectories(); foreach (DirectoryInfo dirInfo in dirInfos) { total +=

How to create a folder in the phone memory (not SD card) in Android?

徘徊边缘 提交于 2021-01-27 23:31:56
问题 I tried the following code to implement what I need File direct = new File(Environment.getRootDirectory() + "/YourFolder"); if (!direct.exists()) { if (direct.mkdir()) { Toast.makeText(getApplicationContext(), "Yes make directory", Toast.LENGTH_LONG).show(); } else { Toast.makeText(getApplicationContext(), "No make directory", Toast.LENGTH_LONG).show(); } } I also added the following permission in the AndroidManifest.xml file <uses-permission android:name="android.permission.WRITE_EXTERNAL

MFC Get Folders

假如想象 提交于 2021-01-27 18:28:09
问题 Hey how do I in MFC get names of all folders? Any examples or which classes should I look into? Any hints will be really appreciated. All I saw is the CFile, which as far as I have seen (though very very little) doesn't looks like it has the ability to do what I want. So please direct me. Thanks 回答1: Look into CFileFind There is an old article in DDJ on how to implement a recursive search using CFileFind . 回答2: A Google search revealed an nice example in: Listing the Files in a Directory It

C++ Find execution path on Mac

两盒软妹~` 提交于 2021-01-27 13:38:35
问题 Lets say my executable is located at /Users/test_user/app on Mac OSX and I am running it from /Users/test_user/Desktop/run_app : Desktop run_app$ /Users/test_user/app/exec Within my C++ code how can I find the path to the location of the executable (which in this case would be /users/test_user/app )? I need to reference some other files at this path within my code and do not want to put absolute paths within the code as some users might place the folder in a different location. 回答1: man 3

Automatic toctree update

三世轮回 提交于 2021-01-27 13:00:44
问题 I'm not sure if this is possible. But I'm hoping to put multiple .rst files in a directory, and during compilation. I want these files to automatically be inserted in the toctree . How can I go about this? 回答1: You can use the glob option which enables wildcards. Like this: .. toctree:: :glob: * This adds all other *.rst files in the same directory to the toctree. Reference: "Use “globbing” in toctree directives" 来源: https://stackoverflow.com/questions/28773398/automatic-toctree-update

Visual Basic List subdirectories in a directory

不想你离开。 提交于 2021-01-27 12:42:08
问题 How can I do this? I tried doing looking in My.Computer.Filesystem and FileIO.Filesystem 回答1: Try this: System.IO.Directory.GetDirectories("Directory Path"); This will return a String() (string array) of the subdirectories. Directory.GetDirectories Method Note that there are 3 overloads for this method. The first one (shown above) simply takes the supplied directory and lists subdirectories. GetDirectories(path, searchPattern) takes the path and a search pattern (like "my*" - which would list

Recursively create directories prior to opening file for writing

折月煮酒 提交于 2021-01-27 06:52:02
问题 I need to write to a file (truncating) and the path it is on itself might not exist). For example, I want to write to /tmp/a/b/c/config , but /tmp/a itself might not exist. Then, open('/tmp/a/b/c/config', 'w') would not work, obviously, since it doesn't make the necessary directories. However, I can work with the following code: import os config_value = 'Foo=Bar' # Temporary placeholder config_dir = '/tmp/a/b/c' # Temporary placeholder config_file_path = os.path.join(config_dir, 'config') if