{"id":39813,"date":"2004-04-14T07:00:00","date_gmt":"2004-04-14T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2004\/04\/14\/not-all-short-filenames-contain-a-tilde\/"},"modified":"2004-04-14T07:00:00","modified_gmt":"2004-04-14T07:00:00","slug":"not-all-short-filenames-contain-a-tilde","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20040414-00\/?p=39813","title":{"rendered":"Not all short filenames contain a tilde"},"content":{"rendered":"<p>I&#8217;m sure everybody has seen the autogenerated short names for  long file names.  For the long name &#8220;Long name for file.txt&#8221;,  you might get &#8220;LONGNA~1.TXT&#8221; or possibly  &#8220;LO18C9~1.TXT&#8221; if there are a lot of collisions.\n  What you may not know is that sometimes there is no tilde at all!\n  Each filesystem decides how it wants to implement short filenames.  Windows 95 uses the &#8220;~n&#8221; method exclusively.  Windows NT adds  the hexadecimal hash overflow technique.  But some filesystems  (like Novell) just truncate the name.  &#8220;Long name for file.txt&#8221;  on a Novell server will come out to just &#8220;LONGNAME.TXT&#8221;.<\/p>\n<p>  So don&#8217;t assume that all short names contain tildes.  They don&#8217;t.  This means no cheating on skipping a call to  <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/fileio\/base\/getlongpathname.asp\">  GetLongFileName<\/a> if you don&#8217;t see any tildes,  since your optimization is invalid on Novell networks.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m sure everybody has seen the autogenerated short names for long file names. For the long name &#8220;Long name for file.txt&#8221;, you might get &#8220;LONGNA~1.TXT&#8221; or possibly &#8220;LO18C9~1.TXT&#8221; if there are a lot of collisions. What you may not know is that sometimes there is no tilde at all! Each filesystem decides how it wants [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-39813","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>I&#8217;m sure everybody has seen the autogenerated short names for long file names. For the long name &#8220;Long name for file.txt&#8221;, you might get &#8220;LONGNA~1.TXT&#8221; or possibly &#8220;LO18C9~1.TXT&#8221; if there are a lot of collisions. What you may not know is that sometimes there is no tilde at all! Each filesystem decides how it wants [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/39813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=39813"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/39813\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=39813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=39813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=39813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}