Questions tagged [fileinfo]

fileinfo refers to the properties of a file that are not part of the content, but rather meta-information such as file type, last modification time, id in the file system, etc. Use this tag for questions about reading / modifying the fileinfo in programmatic ways.

Fileinfo refers to the properties of a file that are not part of the content, but rather meta-information such as file type, last modification time, id in the file system, etc. It can include custom properties such as ID3 tags for audio files.

The list of attributes may vary depending on the file system.

Use this tag for questions about reading / modifying the fileinfo in programmatic ways.

361 questions
4
votes
5 answers

C# How to loop a large set of folders and files recursively without using a huge amount of memory

I want to index all my music files and store them in a database. I have this function that i call recusively, starting from the root of my music drive. i.e. start > ReadFiles(C:\music\); ReadFiles(path){ foreach(file) save to index; …
Tys
  • 3,592
  • 9
  • 49
  • 71
4
votes
3 answers

How to test whether a file is a .Net assembly in C#

I have written the following code: public DataTable GetDotNetAssemblies(string baseDirectory) { DataTable MethodResult = null; try { if (Directory.Exists(baseDirectory)) { List FilePaths =…
WonderWorker
  • 8,539
  • 4
  • 63
  • 74
4
votes
6 answers

Drag drop a file on top of .exe file to get fileinfo

As the title say. I know how to do this in C# only, but when trying to do this with WPF I can't find out where or what to add to read the filename when the program starts. public static void Main(string[] args) { if (Path.GetExtension(args[0])…
Creator84
  • 81
  • 1
  • 4
4
votes
0 answers

Get filesize and other information of asset without fully loading it into memory

I need to get information about an asset without loading it into memory which might take a long time if the asset is very large. As I will be iterating through all assets available in my device, it might take a very long time. I am using the…
vaid
  • 1,390
  • 12
  • 33
4
votes
2 answers

How to get the number of pages of a pdf file in Android?

Can you help me find out the number of pages of a pdf document on Android, that will support down to at least api version 16. I am extracting document information but can't see a solution to get the total amount of pages. This Is what I doo so…
7heViking
  • 7,137
  • 11
  • 50
  • 94
4
votes
4 answers

how do i change a file extension on qt

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…
Nicholas Yu
  • 333
  • 1
  • 5
  • 7
4
votes
1 answer

Mime type "application/CDFV2-corrupt" for Outlook msg file using PHP's finfo_file

I did a little research on Outlook msg files and I expected the mime type to be application/vnd.ms-outlook. But when I use finfo_file(), I get application/CDFV2-corrupt. I've since tried it on two different servers (my local Centos box and my…
user1032531
  • 24,767
  • 68
  • 217
  • 387
4
votes
2 answers

How to get latest file name from folder in directory

Ans: Here is one solution for getting latest file name from folder using c# code Call Function as follows: FileInfo newestFile = GetNewestFile(new DirectoryInfo(@"D:\DatabaseFiles")); Function: public static FileInfo GetNewestFile(DirectoryInfo…
Samad
  • 71
  • 2
  • 10
4
votes
2 answers

How to compare Files in two different Folders and perform conditional copying

I need to copy all the files from one folder (Source) to another folder (Destination). I also need to to compare the two folders and increment a counter that stops at 100 if the content of the two folders are exact match with names only. I do not…
Asynchronous
  • 3,917
  • 19
  • 62
  • 96
4
votes
3 answers

ContentLength vs Actual File.Length

Does anyone has any experience wherein the requested file to download (HTTP) content length in the header does not equal to the actual file length (size) when downloaded?
Jojo
  • 643
  • 10
  • 26
4
votes
0 answers

After enabling fileinfo extension and restarting Apache it still does not load

I want to use fileinfo extension in PHP (5.5). (On localhost(Windows), using XAMPP) So I went to php.ini and commented out extension=php_fileinfo.dll, then I HAVE restarted the apache, even tried to restart the whole PC. But when I try to use it I…
jave.web
  • 13,880
  • 12
  • 91
  • 125
4
votes
4 answers

fileinfo and mime types I've never heard of

I'm not a stranger to mime types but this is strange. Normally, a text file would have been considered to be of text/plain mime but now, after implementing fileinfo, this type of file is now considered to be "text/x-pascal". I'm a little concerned…
Jim
  • 41
  • 3
4
votes
2 answers

Null Object Pattern for FileInfo

I have a method which returns a FileInfo-object. After calling the method fooFile.FullName is called. All fine but there is a case where FileInfo can be null, but I don't want (ugly) null-checks where the method is called. What I neet is some kind…
Micha
  • 5,117
  • 8
  • 34
  • 47
4
votes
3 answers

Parsing a text file using C# StreamReader

I have a text file that contains some hymns in a particular format.Example below. 1 Praise to the Lord 1 Praise to the Lord, the Almighty, the King of creation! O my soul, praise Him, for He is thy health and salvation! All ye who hear, now…
Joel Dean
  • 2,444
  • 5
  • 32
  • 50
4
votes
1 answer

Determine existing Directory of Path

Assume I have an incomplete path-string: C:\dir\temp\f And I have the following filesystem: C:\dir\ c:\dir\temp\ c:\dir\temp\foobar\ c:\dir\temp\foobar2\ c:\dir\temp\bar I want to determine which part of the directory is the best matching. In this…
0xDEADBEEF
  • 3,401
  • 8
  • 37
  • 66