# File name restrictions with Windows NT

**URL:** <https://boards.straightdope.com/t/file-name-restrictions-with-windows-nt/296604>\
**Category:** Factual Questions\
**Created:** [March 28, 2005, 2:22pm UTC](https://boards.straightdope.com/t/file-name-restrictions-with-windows-nt/296604 "2005-03-28T14:22:53Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![B.Serum](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/b.serum/32/14266_2.png) [@B.Serum](https://boards.straightdope.com/u/B.Serum)\
**Post date:** [March 29, 2005, 2:49pm UTC](https://boards.straightdope.com/t/file-name-restrictions-with-windows-nt/296604/21 "2005-03-29T14:49:48Z")

</div>

> [@Nanoda](#):
>
> If the files are on an NT box, then DOS will figure in to things. (It’s there under all the nifty looking stuff in most Microsoft OSs) I just tried to create a file ‘CON’ on my 2k box, and got the error message “Cannot create or replace file: The filename you specified is invalid or too long.” If the file is being stored on an NT server, then at some point it’ll have to take a look at it, and won’t like that.  
> The only reason I’d stick to 8.3 filenames these days is if I was dealing with some embedded DOS device, or was running a particularly old application built for Win 3.1 Go nuts.  
> Microsoft may be able to screw some things up and get away with it, but something like that would be pushing it. 😛  
> Sure. Now I’m all curious about special Mac filenames you’re not allowed to mess up. 🙂

I’m having a hard time following you… I cannot use “nul” or “con” ANYWHERE in a filename - even as _part_ of a filename.

Is this correct?

---

<div class="post-metadata">

**Author:** ![B.Serum](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/b.serum/32/14266_2.png) [@B.Serum](https://boards.straightdope.com/u/B.Serum)\
**Post date:** [March 29, 2005, 2:52pm UTC](https://boards.straightdope.com/t/file-name-restrictions-with-windows-nt/296604/22 "2005-03-29T14:52:52Z")

</div>

> [@longat24](#):
>
> With a mac there are several ways to mount to a CIFS (aka SMB aka Windows file share) and you should consider possibly using a “by hand config”.
> 
> Many of the files that you are going to want to transfer will store the “special” names in an extra “hidden file” with a . prefix. Please note that system 10 converted to a BSD varient which pretty much follows those same “standard” conventions, but uses the . files to “translate” things.
> 
> Now I agree with the other posters that you should really follow “standard” naming conventions, but there might be something else that you could try.
> 
> Open a terminal window  
> cd /mnt (it should just bring you back to the prompt)  
> mkdir TEMP (again it should bring you back to the prompt)  
> For the next command:  
> IP=IP address of the Windows server  
> User=A valid user on that Windows server or the domain  
> SHARE NAME=The volume or share that you are trying to mount, typically this the directory name  
> mount\_smbfs -I \<IP\> //\<USER@IP\>/\<SHARE NAME/\> /mnt/TEMP
> 
> This hopefully comes back to a prompt. Now if you look in finder that volume should be “viewable” as Mac does recognize it, however it now more easily supports unix like commands.
> 
> So now try something like "cp /Users/\<your name\>/\<dir of crud\>/\* /mnt/TEMP/
> 
> This will not mean that Windows users can view your files, but I think you and other Mac users might be able to.
> 
> If this doesn’t work, might I recommend that you use a Linux client running samba which can usually talk to everyone pretty nicely.
> 
> Please note the advice is free, and most likely not worth what you paid. :rolleyes:

I appreciate all the thought and effort you’re putting in here, but the design staff over here is point, click and drag. The process you are recommending is SO not an option. Not even remotely.

---

<div class="post-metadata">

**Author:** ![Bytegeist](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@Bytegeist](https://boards.straightdope.com/u/Bytegeist)\
**Post date:** [March 29, 2005, 5:30pm UTC](https://boards.straightdope.com/t/file-name-restrictions-with-windows-nt/296604/23 "2005-03-29T17:30:56Z")

</div>

> [@Nanoda](#):
>
> Sure. Now I’m all curious about special Mac filenames you’re not allowed to mess up. 🙂

Under the pre-X MacOS, you were wise not to begin filenames with periods. That’s not because such files were “hidden” files, as they are under Unix, but because MacOS signified some device drivers that way — like the “.Sony” driver for the internal 3.5-inch disk drives. So although the HFS filesystem would permit a file beginning with a period, a standard “open” call on that file would likely fail with a “device not found” error, because the OS was trapping the name and trying to locate a driver for that name.

And heaven help you if you actually named a file “.Sony”. What are you, a comedian?

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [March 29, 2005, 11:22pm UTC](https://boards.straightdope.com/t/file-name-restrictions-with-windows-nt/296604/24 "2005-03-29T23:22:02Z")

</div>

> [@Hey you!](#):
>
> I’m having a hard time following you… I cannot use “nul” or “con” ANYWHERE in a filename - even as _part_ of a filename.
> 
> Is this correct?

No. He means that a file named solely NUL (ie 3 letters, no more, no less) would not be legal. a file named NULLify would be fine, as wopuld a file named annulment. Ditto for CON, COM1, COM2, COM3, LPT1, LPT2 or LPT.

Traditional DOS convention is that these names are written in all uppercase, but you would have a problem if you named a file CON or Con or cON. Modern Windows stored the filename however you capitalized it, but considers any variation in capitalization to be the same file. ie save a file named ABcd then try to retrieve a file named acCD and you’ll get the first file back. You can’t have two files whose names differ only by capitalization in the same folder.

As to Nanoda’s assertion that “If the files are on an NT box, then DOS will figure in to things. (It’s there under all the nifty looking stuff in most Microsoft OSs)”, that’s not quite true.

What’s under there is “DOS compatibility”, not DOS. They built Windows with an awwareness that they needed to carry some of the rules of DOS forward into the Windows world during the transition. And since that rule was in effect in Win 3.1 it had to be carried forward when we went to the 9x series, and since it was in effect int eh 9x series it had to be carreis forward into NT & NTFS and …

Those restrictions will be with us until / unless they build a completely new, completely legacy-free (ie incompatible with everything prior) OS and file system.

---

<div class="post-metadata">

**Author:** ![AHunter3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ahunter3/32/368_2.png) [@AHunter3](https://boards.straightdope.com/u/AHunter3)\
**Post date:** [March 30, 2005, 9:14pm UTC](https://boards.straightdope.com/t/file-name-restrictions-with-windows-nt/296604/25 "2005-03-30T21:14:22Z")

</div>

The 31-character limit is probably a consequence of using Windows NT’s built-in AppleTalk stack. In other words, the Mac users aren’t mounting it as a CIFS/SAMBA resource but as an AppleTalk resource. (Windows NT Server’s “Services for Macintosh” makes this possible. Back in the MacOS 9/8/7/etc days there was no native Mac support for Windows-style networking).

NT’s AppleTalk stack uses the old Mac file naming limitations whether the Macs themselves do or don’t.

Regarding the “names you should never name a file”, the older MacOS had one of those also. Under the Classic MacOS (9/8/7/etc), don’t ever name a file “.Sony” and in particular don’t save a file by that name to the root of your startup volume. The OS expects its invisible floppy disk driver to have that name, and the results can be unfortunate.

---

<div class="post-metadata">

**Author:** ![TimeWinder](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@TimeWinder](https://boards.straightdope.com/u/TimeWinder)\
**Post date:** [March 30, 2005, 10:21pm UTC](https://boards.straightdope.com/t/file-name-restrictions-with-windows-nt/296604/26 "2005-03-30T22:21:38Z")

</div>

> [@Nanoda](#):
>
> Sure. Now I’m all curious about special Mac filenames you’re not allowed to mess up. 🙂

The only normal, printable char that’s limited on the Mac is “:” - you’re not allowed to have it in a filename, and if you try to create one manually the Finder silently changes it to a dash. There are a few others that are bad ideas under either the old Mac OS or OS X: files containing “\*” or starting with a period can give you hassles in certain directories or when looking at them as Unix files. The slashes are similar, but I live with them: one of my biggest pet peeves about Windows is not being able to have filenames with slash-delimited dates in them: “Diary 10/25/05” for example.

In Windows, files can’t start or end with spaces, but on the Mac they can; this gives certain file transfer software problems as well.

---

<div class="post-metadata">

**Author:** ![Bytegeist](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@Bytegeist](https://boards.straightdope.com/u/Bytegeist)\
**Post date:** [March 30, 2005, 10:39pm UTC](https://boards.straightdope.com/t/file-name-restrictions-with-windows-nt/296604/27 "2005-03-30T22:39:17Z")

</div>

> [@AHunter3](#):
>
> Regarding the “names you should never name a file”, the older MacOS had one of those also. Under the Classic MacOS (9/8/7/etc), don’t ever name a file “.Sony” and in particular don’t save a file by that name to the root of your startup volume. The OS expects its invisible floppy disk driver to have that name, and the results can be unfortunate.

_Ahem_

I think there’s an echo in here. 🙂

---

<div class="post-metadata">

**Author:** ![AHunter3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ahunter3/32/368_2.png) [@AHunter3](https://boards.straightdope.com/u/AHunter3)\
**Post date:** [April 1, 2005, 1:18am UTC](https://boards.straightdope.com/t/file-name-restrictions-with-windows-nt/296604/28 "2005-04-01T01:18:25Z")

</div>

Sorry 'bout that, **Bytegeist**! I think I opened the thread and then got distracted for a long time before getting around to reading it, and thereby missed reading your post yesterday.

---

<div class="post-metadata">

**Author:** ![galt](https://avatars.discourse-cdn.com/v4/letter/g/35a633/32.png) [@galt](https://boards.straightdope.com/u/galt)\
**Post date:** [April 1, 2005, 2:53am UTC](https://boards.straightdope.com/t/file-name-restrictions-with-windows-nt/296604/29 "2005-04-01T02:53:21Z")

</div>

Don’t forget .Sony

[Previous page](https://boards.straightdope.com/t/file-name-restrictions-with-windows-nt/296604.md?page=1)
