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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:54:37+00:00 2026-06-02T05:54:37+00:00

For normal file path, I can use stat and get size of it. When

  • 0

For normal file path, I can use stat and get size of it. When the path contains non-ascii names like C:\temp\sमानकe\app.log, it does not work.

int main(int argc, char * argv[])
{
      struct stat FileAttrib;

      if (stat(argv[1], &FileAttrib) < 0) {
            printf("File Error Message = %s\n", strerror(errno));
      }
      else
      {
           printf("File size %d\n",  FileAttrib.st_size);
      }
      return 0;
}

stat takes only char *. The path received from command prompt is not really coming a valid file.

enter image description here

  • 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-02T05:54:38+00:00Added an answer on June 2, 2026 at 5:54 am

    Assuming you are using Windows, try using GetShortPathNameW to get the short path name (if it exists), and then pass the short name to stat().

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

Sidebar

Related Questions

Below is an excerpt from an .svg file (which is xml): <text xml:space=preserve style=font-size:14.19380379px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:DejaVu
I have the following entries in the css file. a.intervalLinks { font-size:11px; font-weight:normal; color:#003399;
Using the following explorer.exe /select, c:\path\to\file.txt I can open Windows Explorer and select the
How can I use OLEDB to parse and import a CSV file that each
I always used a normal PHP file and just defined the variables in that
We are looking to replace our normal Win2008 R2 File server with a Azure
Generating normal columnar data in excel file is quite easy but does any one
In a normal Git merge conflict, the three versions of a file in play
I have a class that occasionally gets passed null for File objects. During normal
In normal mode I can hit Ctrl + E which deletes the rest of

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.