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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:22:12+00:00 2026-05-24T22:22:12+00:00

I was wondering, what is the longest possible name length allowed by the Windows

  • 0

I was wondering, what is the longest possible name length allowed by the Windows kernel?

E.g.: I know the kernel uses UNICODE_STRING structures to hold all object paths, and since the byte length of a wide-character string is stored inside a USHORT, that allows for a maximum path length of 2^15 – 1 characters. Is there a similar, hard restriction on a file name (rather than path)? (I don’t care if NTFS or FAT32 imposes a particular restriction; I’m looking for the longest possible theoretically allowed name in the kernel, assuming no additional file system or shell restrictions.)

(Edit: For those wondering why this even matters, consider that normally, traversing a directory is achieved by FindFirstFile/FindNextFile calls, one call per file. Given the function named NtQueryDirectoryFile, which is the underlying system call and which returns multiple file names per call, it’s actually possible to take advantage of this maximum-length restriction on the path to make an extremely-fast directory traverser that uses solely the stack as a buffer. Now I’m trying to extend that concept, and I need to know the maximum size of a file name.)

  • 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-24T22:22:14+00:00Added an answer on May 24, 2026 at 10:22 pm

    Ah, I found this page myself that guarantees that file names can’t be longer than 255 characters:

    • A pathname MUST be no more than 32,760 characters in length.
      …
    • Each pathname component MUST be no more than 255 characters in length.

    Which makes me wonder:

    Why does Windows use ULONGs for file name lengths, when it uses USHORTs for path lengths?!

    If anyone knows why this is, please post/comment! I’m rather curious. 🙂

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

Sidebar

Related Questions

wondering how to carry out this requirement if at all possible. I am modifying
I'm wondering for some time now why this fails: if (longest.length >= 3) {
wondering if some of you know what javascript framework facebook is using ? Thanks
I've been wondering for the longest time WHY I actually need a live resource
I was wondering, how long in number of characters would the longest a double
wondering how I can replace all special chars on my string like: hello this
Wondering, if possible, how I would go about sorting entities from an NSSet by
Wondering if this is possible or something with this effect. public class MyModel {
Wondering if it is possible for my claims aware application (ASP.NET) to save a
Wondering if it would ever be useful to index every possible state of an

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.