FAQ Database Discussion Community


how to know actual file type in java

java,file-extension
I have file for example 5555.33 but in fact file is arj archive file String ext = FilenameUtils.getExtension("C:\\5555.33"); the Extension returns 33 file. How to get actual file type arj from this file...

C: Saving specified files with unique extensions

security,encryption,file-extension,file-type
I'm actually curious on this one. Hypothetically, let's say I wanted to make a notepad program, so the user can make documents. The user can put in anything s/he desired without a limit. For privacy so only that program opens it, can I use a specific (undesigned) extension for the...

Matching all the file extensions

r,file-extension
I have a vector of file extensions like (.txt,.TXT,.csv,.xls), i tried "\\.(TXT|txt|csv|xls)$" according to this which return TRUE if any of the extensions are present, however i am interested to return a TRUE if all the extensions are present in the vector otherwise FALSE. Thanks

Sort files in a folder and its subfolders by type and size

bash,file,size,aggregate,file-extension
I have to count a huge number of files in a directory and subdirectories recursively by extension and get the total size for each extension. I do not want to see individual files with their type and size next to them. For example, this would be one potential output: JPEG...

Add an extention to the file you want to save

c++,winapi,file-extension,savefiledialog
The problem is that I need to add an extension to the file name when I save it. Solution like outfile.open(filename + ".txt") doesn't seems to work in my case. There is my code: SaveFileDialog* saveFileDialog1 = new SaveFileDialog(); int saveAs(const string& outFileName) { string bufFile("C:\\Windows\\tmp.XXXXXX"); string outFile(saveFileDialog1->NewFileName); string line;...

R files in capital and lowercase. Difference?

r,rstudio,file-extension
Someone gave me some "R" files. Some of them are saved with a capital "R" extension, i.e. ".R", and some are saved with a lowercase extension, i.e. ".r". I can open the lowercase ones fine, but the uppercase ones say that permission is denied? My questions: - What is a...

.blade extension in laravel 5 is not working?

php,routes,blade,file-extension,laravel-5
Laravel 5 - Blade Extension Error I started using laravel 5 recently and its new. I'm using linux ubuntu 14.10. Here is my code in the file app/Http/routes.php Route::get('/test',function(){return view('test');}); And I have created the test view here resources/views/test.blade.php The error is when I use the .blade.php extension for test...

How to compare extension of files in an array and throw error?

php,arrays,foreach,associative-array,file-extension
I've following array of file extensions titled $aSupportedImages: Array ( [0] => jpeg [1] => jpg [2] => gif [3] => png ) I've another array titled $values as follows : Array ( [vshare] => Array ( [course_error.png] => Array ( [0] => https://www.filepicker.io/api/file/Y0n99udSqS6ZJWYeYcUA ) [before_login.png] => Array ( [0]...

Associate file extension to python script, so that I can open the file by double click, in windows

python,windows,file-extension,file-association
I want to do the following: Save numeric data in a CSV-like formatting, with a ".foo" extension; Associate the ".foo" file extension with some python script, which in turns opens the .foo file, reads its content, and plots something with a plotting library (matplotlib most probably). The use-case would be:...

Purpose of file with extension ^^^ in Pervasive SQL

sql,database,file-extension,pervasive
I'm researching a file extension "^^^". Found the following info about this extension on FileInfo.com: "Database file used by Pervasive.SQL database software; based on the Btrieve transactional database format; created by the database engine when the database is placed in Continuous Operations mode." But it's not entirely clear what's the...

Grouping file extensions for re-writing URL's [.htaccess]

.htaccess,mod-rewrite,url-rewriting,rewrite,file-extension
How can I group these two together; is it like ".(html|php)$" - please provide the code. Note, the answer should work for all file extensions: what is your thoughts on removing every file extension; comment on the code used - as it is rare to find. RewriteCond %{THE_REQUEST} ^GET\ (.*)\.html\...

check if a file extension is part of a given list

qt,file-extension,qlist,qfileinfo
I am trying to make a simple widget which contains a lineedit which shows the file name and a button to open a filedialog. and now I want to check if the file-extension is valid, in this case, a image file ending with jpg, png or bmp. I solved this...

Python program to produce dictionary of file extensions and sizes

python,dictionary,filesize,file-extension
I am trying to create a program in Python that will search through a directory of files and create a dictionary whose keys are the various file extensions in the directory, and whose values constitute lists containing the number of times that extension appears in the directory, the size of...

Batch script, file drag&drop, change extension and reload file

batch-file,drag-and-drop,rename,file-extension
I have a batch script which accepts >=1 files via drag & drop. The full paths are kept in an array and later fed to another program as input. The file name+extension is kept in another array which is then shown to the user. I am trying to check the...

how do i change a file extension on qt

c++,qt,file-extension,fileinfo
I have a piece of code to download a file from server. However, due to server constraint, I can not put .exe file at server. So I rename my XXX.exe file to XXX.alt(just a random extension) and put it on server. Now my code can download XXX.alt, but how can...

How to remove the word 'index' in the url [.htaccess]?

.htaccess,mod-rewrite,redirect,url-rewriting,file-extension
Currently, I am using the below code to remove the word 'index' in my urls - however, the issue is that it allows for two versions: one without and one with [the word] - hence, I have referenced the one without (in the HTML) - but the user still might...

Batch to remove all files in folder + subfolder except some filetypes

batch-file,delete,file-extension,subfolder
I have a folder with thousand of subfolders. There are many files like .cfg's or .txt's, that are unnecessary. I only need the folders with files that contain .png and .jpg . So the procedure should be: Find all files except .png and .jpg files and delete them Check all...