Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9086363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:28:15+00:00 2026-06-16T21:28:15+00:00

is it possible to extract ‘some’ properties from a given file without using System.IO.FileInfo

  • 0

is it possible to extract ‘some’ properties from a given file without using System.IO.FileInfo at all?

I mean, I love using FileInfo in cases where I just have a few files to deal with, but if, for example, I want to grab a list of file names from, let’s say, half a million files and I decide to use FileInfo… it takes for-darn-ever!

I suspect that FileInfo loads a bunch of other stuff about that file into memory (is that correct?). If so, I feel like there should be a faster way to, say, just grab name or file extension.

On the other hand, I could just use Directory.GetFiles(myPath), but this gives me an array with the full paths for every file, while I just need the name per file!
(I guess I could parse the path string to extract the name from it… would that be faster than using FileInfo?)

What other alternatives are out there if I want to accomplish this (grab the name of the file, or grab the file extension) faster?

Thank you very much!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T21:28:17+00:00Added an answer on June 16, 2026 at 9:28 pm

    You’re looking for the methods in the Path class.

    Specifically, Path.GetFileName() and Path.GetExtension().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to extract a single file or diff of a file from
I'm using the Resharper trial and VS2008. Is it possible to extract all classes
How to extract multiple data from XML file using NSIS? I used UpdateXml to
Is it possible to extract month element from the date using SPARQL and group
is that possible to extract out all the data in second sheet from each
Possible Duplicate: Extract the return type of a function without calling it (using templates?)
Is it possible to extract all possible metro stations/ bus stops from a path
Is it possible to extract a particular line from a file knowing its line
Possible Duplicate: Extract numbers from a string I am using preg_match() to extract a
Is it possible to extract all of the VBA code from a Word 2007

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.