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

  • SEARCH
  • Home
  • 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 6008205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:47:29+00:00 2026-05-23T01:47:29+00:00

From the MSDN documentation for the FileInfo.Name property, I see that the data for

  • 0

From the MSDN documentation for the FileInfo.Name property, I see that the data for the property is cached the first time it is called and will only be updated subsequently by using the Refresh method.

I’ve the following questions which I can’t find or aren’t too clear in the documentation:

  1. Is the data for all properties cached at the same time?

  2. Is the Refresh method called on creation of the FileInfo, or only when a property is called for the first time?

  3. If I’ve called one property, e.g. the Name property, and it’s called Refresh, will calling a different property, e.g. the DirectoryName property, for the first time cause it to call Refresh again, or is it only called by the first property accessed in the entire class (see question #1)?

  4. Can I pre-cache all the properties by calling Refresh manually? (Assuming it’s not pre-cached on construction of the object)

  5. Does calling Refresh manually cause properties which are pre-cached, e.g. CreationTime, to be refreshed as well?

  • 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-05-23T01:47:30+00:00Added an answer on May 23, 2026 at 1:47 am
    1. At a guess, yes. It seems like a bit of a self-defeating “optimisation” for FileInfo to fetch only the properties you’ve fetched before, especially when they can be (and probably are) all fetched in one API call.

    2. The fact that the documentation calls out DirectoryInfo methods which serve up already-cached FileInfos suggests quite strongly (to me, anyway) that simply constructing a FileInfo doesn’t cache anything. It makes sense – if you construct a FileInfo directly, it might refer to a file that doesn’t exist yet (you plan to create it, for instance), whereas all the methods which return cached FileInfos refer to files that exist at the time of the snapshot, under the assumption you’re going to use at least some of them.

    3. No, by my answer to question 1. That’s why the Refresh method is there.

    4. I would imagine so (see answer 1).

    5. Yes. See answer 3.

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

Sidebar

Related Questions

Description for Assert.Equals() from the MSDN Documentation: Do not use this method. That's it,
From the MSDN documentation: Synchronized supports multiple writing threads, provided that no threads are
From the documentation here http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.login.layouttemplate.aspx i had customized the user interface of login control
From MSDN doc : A delegate is a type that safely encapsulates a method,
From MSDN Types that implement IComparable must override Equals.Types that override Equals must also
From MSDN documentation, it seems as both GetHashCode() and Equals() haven't been overriden in
I know which languages the OS is available in from the MSDN documentation but
The MSDN documentation on WebBrowser Customization explains how to prevent new windows from being
In the MSDN documentation, it documents that you can set the UpdateSourceTrigger to an
I looked up the msdn documentation and it says that InvalidUserName is thrown when

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.