0

I want to save information about existing SMB shares on my Windows system to a file and have determined max number of characters that can be used by the following properties to be:

Share Name: 80 chars
Scope Name: 256 chars
Path: 260 chars
Description: 256 chars

How do I calculate the space (in bytes) that will be occupied by this information?

user1071840
  • 3,522
  • 9
  • 48
  • 74
  • 1
    Windows internally uses UTF-16 for just about everything. But I'm not sure if there are cases where a pair of surrogates would count as one character instead of two. In any case you may want to use a different encoding for writing to a file. – Mark Ransom Sep 06 '18 at 21:21
  • That 260 limit you hitting is known as `MAX_PATH`. And a path can be longer if the application code uses the right naming conventions. Read more here: https://stackoverflow.com/questions/2825798/should-i-deal-with-files-longer-than-max-path – selbie Sep 07 '18 at 08:19

0 Answers0