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
0
votes
2 answers

How to get full file path on Asp.net?

I'm using Asp.net treeview to show my directory including files. I want to show the file path once the user click on the treeview node. I'm using FullName property to get the path. The problem that I have is, treeview shows the full path only for…
HardCode
  • 2,025
  • 4
  • 33
  • 55
0
votes
1 answer

Creating FileInfo - Unexpected Behavior

I am trying to create a file with a FileInfo object and I am getting strange behavior. Here is the gist of what I am doing - public void CreateLog() { FileInfo LogFile = new FileInfo(""); if (!LogFile.Directory.Exists) {…
William
  • 3,335
  • 9
  • 42
  • 74
0
votes
2 answers

What is a surefire way of getting a file's true creation time?

I need to know when a file that I'm downloading was created, or last written to. Just the date is all I need (such as 6/17/2011). Normally, the file's date can be sussed out by its name, such as "DonQuixoteWasRight.2011-06-17.log" The problem is…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
0
votes
3 answers

FileInfo - Select one File out of one FileInfo[]

i have two FileInfo[] Array's and i want compare the Files with identical Names about their File Size and Last Modified Date. But how can i select a File out of a FileInfo[] with a specific Name? My Code doesnt work, because i cant use…
The_Holy_One
  • 321
  • 5
  • 16
-1
votes
2 answers

Upload a file, MemoryStream vs FileInfo

I have to generate some files in my asp.net web application and send it to the client. So I made a method who work with a memory stream and send the buffer to the http response. It is working fine but I just read another code and the guy is using a…
bAN
  • 13,375
  • 16
  • 60
  • 93
-1
votes
1 answer

DirectoryInfo.GetFiles with multiple filters

I am trying to get a list of FileInfo objects that satisfy multiple filters. Every suggestion I have seen uses array of file names/paths instead of FileInfo: var files = Directory.GetFiles(sLogPath, "*.*", SearchOption.TopDirectoryOnly) …
NoBullMan
  • 2,032
  • 5
  • 40
  • 93
-1
votes
1 answer

Building full path to file, which is inside a folder inside the directory of the executing program

Inside the directory of the .exe, there is a folder called exports. I have a method that takes parameters for a directory and filename. In this case, I want to give the directory as this exports folder. The following is the current code: public void…
Al2110
  • 566
  • 9
  • 25
-1
votes
1 answer

Best workaround for not being able to inherit a sealed class?

I am making a program that processes thousands of files. For each file I create a FileInfo instance, but I am missing some methods and properties that I need. I wanted to make my own custom FileInfo class by inherting from FileInfo, but that class…
Mytzenka
  • 205
  • 1
  • 3
  • 16
-1
votes
1 answer

Identifying an existing folder

I have an issue where it seems go is telling me that a folder doesn't exist, when it clearly does. path, _ := reader.ReadString('\n') path, err := expand(path) fmt.Println("Path Expanded: ", path, err) if err == nil { if _, err2 :=…
Krum110487
  • 611
  • 1
  • 7
  • 20
-1
votes
1 answer

Add specific images to FileInfo[]

I have a FileInfo object that receives all images from a directory:- string Path = HttpContext.Server.MapPath("~/Content/TempImages/"); DirectoryInfo directory = new DirectoryInfo(Path); FileInfo[] files = directory.GetFiles(); This works fine and…
Sherry8212
  • 67
  • 1
  • 11
-1
votes
1 answer

how to append items to []os.FileInfo in GoLang

I'm making a function like ioutil.ReadDir() but recursively due I want all the files in folders and subfolders and ioutil.ReadDir() just do it in the specified folder but I don't know how to append items to an array of []os.FileInfo that I've…
Javier Salas
  • 1,064
  • 5
  • 15
  • 38
-1
votes
1 answer

Inheriting from the abstract class FileSystemInfo produces not values for all FileInfo members, only for some

I created a class CFileInfo which inherits from the abstract FileSystemInfo class. My constructor assigns a new FileInfo object to a class-wide variable. 3 members must be overridden (Name, Exists, Delete). However, other members are not declared…
user1889116
-1
votes
1 answer

Illegal characters in path. Searching directories

I'm trying to read a file to get the path and then search that path. C:\Users\Public\Documents\ScriptPath.txt contains "C:\Users\Public\Music Folder\" and here is my code string ScriptPath =…
-1
votes
3 answers

Get most recent file with a certain prefix

I am trying to get the most recent file from a directory that also has a certain prefix. I am able to successfully use the code if I don't put the search string overload in after getfiles(), but if I do use it, I get an exception stating: An…
user3494110
  • 417
  • 2
  • 9
  • 25
-1
votes
3 answers

How to remove FileInfo in Array List that already processed in .Take()

here is the code : // Files has 25 PDF var Files = Folder.GetFileToPublicFolder(Folder.srcFolder); foreach (FileInfo file in Files) { // Get 10 PDF in Files List files =…
Ryan Ayala
  • 77
  • 1
  • 8