file-extension

Associating certain file extension to my android application

試著忘記壹切 提交于 2019-11-28 10:11:50
I'm having trouble associating my custom file extension to my android application that I am developing. In my android manifest file I have the following: <data android:scheme="file" android:mimeType="*/*" android:pathPattern="*.*\\.myFileExt" /> <data android:scheme="content" android:mimeType="*/*" android:pathPattern="*.*\\.myFileExt" /> It kinda works. Let me explain. I have a file in my gmail( sent a file to my self ), which has the proper extension, so when I download it from my phone's browser and click open, it opens my application correctly, but if I explore to that file path; where the

Remove filename extension in Java

守給你的承諾、 提交于 2019-11-28 08:11:07
(Without including any external libraries.) What's the most efficient way to remove the extension of a filename in Java, without assuming anything of the filename? Some examples and expected results: folder > folder hello.txt > hello read.me > read hello.bkp.txt > hello.bkp weird..name > weird. .hidden > .hidden (or should the last one be just hidden ?) Edit : The original question assumed that the input is a filename (not a file path). Since some answers are talking about file paths, such functions should also work in cases like: rare.folder/hello > rare.folder/hello This particular case is

What are the .db-shm and .db-wal extensions in Sqlite databases?

只谈情不闲聊 提交于 2019-11-28 05:39:28
I am seeing some strange behavior with my application and the state of its database file after running some tests that close the database, delete it, and replace it with a test fixture. When I examine the database file with a tool on my debugging PC, it doesn't match what the application itself seems to be reporting. It's possible that this strange behavior is related to this bug . I noticed that there are two files with the same base name as the database (with the normal .db extension.) The file extensions are .db-shm and .db-wal , and each is newer than the .db file's timestamp. I assume

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

天大地大妈咪最大 提交于 2019-11-28 03:40:14
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? .a is an archive of code: compiled but not linked. You would link statically with it during your program's final link step. .lib can be either the same as .a, or a magical so-called "import library": a thin placeholder which causes you to require a .dll at runtime. On Unix systems you have the .a files. These are

recursively add file extension to all files

本小妞迷上赌 提交于 2019-11-28 02:40:28
I have a few directories and sub-directories containing files with no file extension. I want to add .jpg to all the files contained within these directories. I've seen bash scripts for changing the file extension but not for just adding one. It also needs to be recursive, can someone help please? Alternative command without an explicit loop ( man find ): find . -type f -exec mv '{}' '{}'.jpg \; Explanation: this recursively finds all files ( -type f ) starting from the current directory ( . ) and applies the move command ( mv ) to each of them. Note also the quotes around {} , so that

Hide Page Extensions (Like StackOverflow)

安稳与你 提交于 2019-11-28 02:12:36
I want to hide page extensions like stackoverflow does. How does the following work? http://stackoverflow.com/tags/foo http://stackoverflow.com/tags/bar I've seen a lot of sites that do this, but I still don't know how this is accomplished (I have a LAMP stack). When a web server gets a request for a URL, it has to decide how to handle it. The classic method was to map the head of the URL to a directory in the file system, then let the rest of the URL navigate to a file in the filesystem. As a result, URLs had file extensions. But there's no need to do it that way, and most new web frameworks

Javascript If statement used to check file extensions not working

让人想犯罪 __ 提交于 2019-11-28 01:44:10
I have a form in which people can enter file paths. I want to make sure that the paths they are entering point to pictures so here is what I thought would work. function checkExt() { var extension= /* I know that the code to cut the extension off of the file is working correctly so for now let's just go with it ok */ if(extension!="jpg" || "gif" || "bmp" || "png" || "whatever else") alert("The file extension you have entered is not supported"); } But this does not work. I have tracked it down to the if statement because if I select only 1 kind of file to check for, then it will work correctly.

PHP: Get file extension not working on uploads to S3

一个人想着一个人 提交于 2019-11-28 01:03:32
I am using the Amazon S3 API to upload files and I am changing the name of the file each time I upload. So for example: Dog.png > 3Sf5f.png Now I got the random part working as such: function rand_string( $length ) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $size = strlen( $chars ); for( $i = 0; $i < $length; $i++ ) { $str .= $chars[ rand( 0, $size - 1 ) ]; } return $str; } So I set the random_string to the name parameter as such: $params->key = rand_string(5); Now my problem is that this wont show any extension. So the file will upload as 3Sf5f instead of

Can I tell Visual Studio how treat a file with a custom file extension?

狂风中的少年 提交于 2019-11-27 23:04:52
问题 Can I tell Visual Studio how treat a file with a custom file extension? I want to be able to open a file with ".xxx" extension in Visual Studio and have CSS highlighting. I've tried to do it by going to VS -> Tools -> Options -> Text Editor -> File Extension but in the Editor drop down there is nothing to specify "treat it as CSS". 回答1: There is a registry hack that you can use. http://www.engagesoftware.com/Blog/EntryId/117/Editing-SqlDataProvider-scripts-within-Visual-Studio.aspx Basically,

Is an Application Associated With a Given Extension?

断了今生、忘了曾经 提交于 2019-11-27 21:25:53
It is sometimes desirable to have your application open the default application for a file. For example, to open a PDF file you might use: System.Diagnostics.Process.Start("Filename.pdf"); To open an image, you'd just use the same code with a different filename: System.Diagnostics.Process.Start("Filename.gif"); Some extensions (.gif for example) just about always have a default handler, even in a base Windows installation. However, some extensions (.pdf for example) often don't have an application installed to handle them. In these cases, it'd be desirable to determine if an application is