file-extension

count number of files with a given extension in a directory - C++?

Hi there, Is it possible in c++ to count the number of files with a given extension in a directory? I'm writing a program where it would be nice to do something like this (pseudo-code): if (file_extension == ".foo") num_files++; for (int i = 0; i < num_files; i++) // do something Obviously, this program is much more complex,...

Finding the preferred application for a given file extension via unix shell commands

Hi, this may not be strictly about programming, but if I find no ready-made solution it may become a programming task: On UNIX, what is a command-line method for determining the user-preferred application for a given filetype? My ideal solution here would be a command that stopped me having to do the following: okular foo.pdf And al...

Create a file extension for theme builder

I am making a theme builder for iPhone/iPod touch. Usually the folders are suffixed with .theme. For my application, could I possible make an file extension, .iTheme, and associate my application with the .iTheme extension? ...

Least resource-intensive way to set up 4 'pretty' URLs?

I'm planning an API for my own use, in Python. Perhaps someday I will make it freely accessible, but now I'm only planning to use it on my hobby site. At this stage I need some advice on how to set up the URLs, for files that receive both GET and POST requests. Suppose one of my files is called function_A.py and used in this fashion: w...

Indicate programming language in a file without extension

When writing executable scripts, and declarative configuration files that use a common language (eg. Python), I often find it undesirable to add an extension to the file name. Many syntax-highlighting text editor (eg. Geany) are subsequently unable to automatically determine the filetype. Is there any standard method for indicating to e...

How to install new filetype associations in registry

Does anyone know how to register any extension into the registry and open it with program X in C#? For instance, when installing Word, it adds the extensions .doc, .docx etc... and then when you double click on the file Word opens up this file. This I want to achieve with my own program. Double clicking file.xxx opens up the contents usi...

ASP.NET MVC Actions + Extension

i want have mvc actions plus file extension like /Home/Index.aspx which route to Index action of Home Controller. can everybody help me. have everybody any opinion or guideline? ...

Need info about how to associate my applications file extensions with the application using InstallShield 2010

I am using InstallShield 2010 to create an installer for my application but I am having trouble finding any info about how to associate the file extensions my applications uses with the application. Can anyone link me to some docs or give me a quick run down on how to do this? My application is a java application and I am trying to cre...

Associate a file extension with WPF application

I have a nice little assignment organizer that I want to add a backup option to. But I don't want it in an ordinary xml file or someother file because of the possibility of file corruption. So how can I make a file extension that the program knows and can save to and open with a .asog file extension? ...

Opening a php file in eclipse from windows

I have changed my .php file extension association in windows to use eclipse to open .php files. When I double-click a php file, it opens just fine as long as eclipse is not already open. If eclipse is already open it tries to open ANOTHER one. None of my other programs (UltraEdit, Winzip, etc) are retarded like this. How do I get e...

Where can I get the list of most common file extensions and their content type?

So far I have: doc, dox -> application/ms-word xls, xlsx -> application/ms-excel pdf -> application/pdf And so on. Is there a place where I can get a comprehensive list? ...

Internet Explorer removes .exe extension from download when followed by URL parameters

I am serving files from Amazon S3 now, and I generate a secure URL using the API. Works great everywhere except for people downloading .exe files in IE. I have tested this on IE 8 and 7. If running a local webserver you can test by putting notepad.exe in your web root. Go to http://localhost/notepad.exe (or equivalent) Now try http:/...

How to decide on document file extension?

I'm writing a new document-based cross-platform chemistry application (Win, Mac, Unix), which saves files in its own format (no standard format exists for this field). I'm trying to decide on a file extension for the saved files. My questions are: How important is it nowadays to stick to 3 characters? Where can you check how much this ...

What's the difference between .lib and .a files?

I'm trying to statically compile something and I'm trying to get a handle on what all these dependencies are. I know that .dll files are for dynamically linked dependencies that will be required by the final output, but what are .a and .lib files and when do you need each of those? ...

How to remove the file extension in a zsh completion?

I want to adjust zsh so that I can tab complete: myprog <tab> using all *.foo files in ~/somedir, but have it so that it displays them without the .foo extension. Is there any way to do this? This is what I have so far: #compdef myprog typeset -A opt_args local context state line local -a mydirs mydirs="(. ~/somedir)" _arguments -...

Allow user to download file and filename on client defaults to no extension

I want the user to be able to download a file from a page and have the filename extension in the Save As dialog box to be defaulted to nothing. This is the code I'm using: Response.ContentType = "text/plain" Response.AppendHeader("content-disposition", "attachment; filename=FILE") Response.WriteFile("C:\Temp\FILE") Response.End() FIL...

visual c# open own file extention

hello everybody, first: i'm dutch so sorry if my english is not so good. I have made my own file type (.ddd) and I made a simple program to open this file type, but wenn i click on a .ddd file (on my desktop) my program opens only the file is not automaticly opend inside my program. how do I directly open the file in my program when ...

QFileDialog filter from mime-types

I want the filter in a QFileDialog to match all audio file types supported by Phonon on the platform in question. 1 - However I am not able to find a way in Qt to use mime types in a filter. How can I do that? 2 - Or how can I find the corresponding file extensions for the mimetypes manually? The solution should be Qt based, or at leas...

Tutorial for Quick Look Generator not associated with .app

I've checked out Apple's Quick Look Programming Guide: Introduction to Quick Look page in the Mac Dev Center, but as a more of a science programmer rather than an Apple programmer, it is a little over my head (but I could get through it in a weekend if I bash my head against it long enough). Does anyone know of a good basic Quick Look G...

how to remove extension from file name?

I want to throw the last three character from file name and get the rest? I have this code: char* remove(char* mystr) { char tmp[] = {0}; unsigned int x; for (x = 0; x < (strlen(mystr) - 3); x++) tmp[x] = mystr[x]; return tmp; } ...