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 8972209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:09:44+00:00 2026-06-15T18:09:44+00:00

When running the this sample code from QFileInfo documentation: QFileInfo fi(/tmp/archive.tar.gz); QString base =

  • 0

When running the this sample code from QFileInfo documentation:

 QFileInfo fi("/tmp/archive.tar.gz");
 QString base = fi.baseName();  // base = "archive"

Would it result in accesses to the file system?

I’m assuming that calling fi.lastModified() or fi.exists() would require the file system to be accessed, but what about it I only use it to extract parts of the file name (extension, base file name, only the directory, etc.)?

  • 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-15T18:09:46+00:00Added an answer on June 15, 2026 at 6:09 pm

    Without looking at the implementation of methods it is hard to say precisely which method access the filesystem and which not. But I found in the library this sort of explanation that answer your question:

    Performance Issues

    Some of QFileInfo‘s functions query the file
    system, but for performance reasons, some functions only operate on
    the file name itself. For example: To return the absolute path of a
    relative file name, absolutePath() has to query the file system. The
    path() function, however, can work on the file name directly, and so
    it is faster.

    Note: To speed up performance, QFileInfo caches
    information about the file. Because files can be changed by other
    users or programs, or even by other parts of the same program, there
    is a function that refreshes the file information: refresh(). If you
    want to switch off a QFileInfo‘s caching and force it to access the
    file system every time you request information from it call
    setCaching(false).

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

Sidebar

Related Questions

I'm trying to run the sample code from this Sun tutorial: http://download.oracle.com/javase/6/docs/technotes/guides/rmi/hello/hello-world.html I've copied
I've tried writing this code from scratch, coding, and running it but it just
Running this query takes a long time: SELECT host,ip FROM arecords WHERE ip IN
When running this XNA application it should display a rotated rectangle that moves from
After running this query statement with my database: select * from articles where content
The below code is a sample code from the msdn( link ) about how
I have a following sample code from my lecture note. int[] a = new
I am looking at the 'Metronome' sample code from the iOS SDK ( http://developer.apple.com/library/ios/#samplecode/Metronome/Introduction/Intro.html
I've written some sample code which when I call from the windows command prompt
I want to try out the example code from this article: Load Recovery.gov Grant

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.