filenames

How to change the default C++ file extension in Eclipse CDT when creating a new file?

元气小坏坏 提交于 2019-12-01 06:34:40
My team has been mandated to use a specific coding standard, and part of that standard is to use .cc as the suffix for C class implementation files (for sake of argument, it could have been .cxx, .c++, or any number of other suffixes which are not .cpp). We're using the Eclipse CDT (C/C++ Development Toolkit) for development, however in the "New C++ Class" dialog, when you type in a class name as Classname, for example, it automatically names your Source file as Classname.cpp. Sure, I could uncheck the "use default" checkbox and repair the suffix, but that's a few extra steps, and a lot to ask

How can to get the filename from a streaming mapreduce job in R?

社会主义新天地 提交于 2019-12-01 05:56:14
问题 I am streaming an R mapreduce job and I am need to get the filename. I know that Hadoop sets environment variables for the current job before it starts and I can access env vars in R with Sys.getenv(). I found : Get input file name in streaming hadoop program and Sys.getenv(mapred_job_id) works fine, but it is not what I need. I just need the filename and not the job id or name. I also found: How to get filename when running mapreduce job on EC2? But this isn't helpful either. What is the

C++ - Load all filename + count the number of files in a current directory + filter file extension

会有一股神秘感。 提交于 2019-12-01 05:34:14
问题 I want to count the number of file in the current directory as well as load all file names in the array. If possible, I want to know how to filter file extension also 回答1: Link the following program with -lboost_filesystem #include <iostream> #include <string> #include <vector> #include <boost/algorithm/string/case_conv.hpp> #include <boost/filesystem.hpp> int main( int argc, char ** argv ) { std::string ext = ".jpg"; std::vector<std::string> files; for ( boost::filesystem::directory_iterator

Qt - Don't append major version number to the end of executable/library name

本小妞迷上赌 提交于 2019-12-01 04:06:34
问题 How can I stop Qt from renaming my DLL to MyDLLName{MAJOR_VERSION_NUM}.dll ? This only happens when I set the VERSION in my project file, but I also want to set the version. For example, if I have: VERSION = 1.2.3.4 And my library is named MyDll , it will create my DLL in the debug folder as MyDLL1.dll . If I take the version number away, it keeps the name as I want it ( MyDLL.dll ). Thanks. 回答1: Use this: CONFIG += skip_target_version_ext 回答2: See this answer (on SO) for why it is there: Why

What is the most reliable way of using GNUMake with filenames containing spaces?

最后都变了- 提交于 2019-12-01 04:02:50
I want to use GNUMake to run a rule-based makefile which builds a set of C files in a directory structure (on a Windows file system). The root directory, some sub-directories and some files contain spaces. Example file: "C:\Documents and Settings\<username>\My Documents\Test Dir\Build Me.c" GNUMake doesn't really work when the file paths contain spaces. I've read about the possible ways of working around this issue (removing the spaces from my filenames, using the 8.3 format, substituting spaces with ? or \\ etc.) but none of them are perfect (or are they?) Is there a silver bullet that will

How to get a batch file to handle spaces in file names?

泪湿孤枕 提交于 2019-12-01 03:56:06
I am using the following batch file to make a zip file for each xml in a folder: FOR %%f in ("C:\files\*.xml") DO 7za.exe a C:\files\zips\%%~nf.zip (%%f) However if the file name has a space in it ( test plop.xml ) then the batch file does not work. It seems to split the name and thinks it is 2 files. How to modify the batch file so that it properly handles file names with spaces? Try placing quotes around the output file name. Change FOR %%f in ("C:\files*.xml") DO 7za.exe a C:\files\zips\%%~nf.zip (%%f) to: FOR %%f in ("C:\files*.xml") DO 7za.exe a "C:\files\zips\%%~nf.zip" (%%f) May also be

PathCanonicalize equivalent in C#

拜拜、爱过 提交于 2019-12-01 03:45:27
What is the equivalent to PathCanonicalize in C#? Use: I need to take a good guess whether two file paths refer to the same file (without disk access). My typical approach has been throwing it through a few filters like MakeAbsolute and PathCanonicalize, and then do a case-insensitive comparison. quick and dirty: In the past I have created a FileInfo object from the path string and then used the FullName property. This removes all of the ..\'s and the .\'s. Of course you could interop: [DllImport("shlwapi", EntryPoint="PathCanonicalize")] private static extern bool PathCanonicalize(

How do I write a file whose *filename* contains utf8 characters in Perl?

走远了吗. 提交于 2019-12-01 03:39:09
I am struggling creating a file that contains non-ascii characters. The following script works fine, if it is called with 0 as parameter but dies when called with 1 . The error message is open: Invalid argument at C:\temp\filename.pl line 15. The script is started within cmd.exe . I expect it to write a file whose name is either (depending on the paramter) äöü.txt or äöü☺.txt . But I fail to create the filename containing a smiley. use warnings; use strict; use Encode 'encode'; # Text is stored in utf8 within *this* file. use utf8; my $with_smiley = $ARGV[0]; my $filename = 'äöü' . ($with

How can I write out multiple files with different filenames in R

那年仲夏 提交于 2019-12-01 01:59:11
I have one BIG file (>10000 lines of data) and I want write out a separate file by ID. I have 50 unique ID names and I want a separate text file for each one. Here's what Ive got so far, and I keep getting errors. My ID is actually character string which I would prefer if I can name each file after that character string it would be best. for (i in 1:car$ID) { a <- data.frame(car[,i]) carib <- car1[,(c("x","y","time","sd"))] myfile <- gsub("( )", "", paste("C:/bridge", carib, "_", i, ".txt")) write.table(a, file=myfile, sep="", row.names=F, col.names=T quote=FALSE, append=FALSE) } One approach

What is the most reliable way of using GNUMake with filenames containing spaces?

随声附和 提交于 2019-12-01 01:37:20
问题 I want to use GNUMake to run a rule-based makefile which builds a set of C files in a directory structure (on a Windows file system). The root directory, some sub-directories and some files contain spaces. Example file: "C:\Documents and Settings\<username>\My Documents\Test Dir\Build Me.c" GNUMake doesn't really work when the file paths contain spaces. I've read about the possible ways of working around this issue (removing the spaces from my filenames, using the 8.3 format, substituting