I just tried the same on the Mac (in TextEdit). If you start with a slash, you get a 'go to directory' dialog. If you enter a slash later in the filename, it saves with a slash in the filename. The 'magic' is that it actually uses colons, which are shown as slashes in the UI. If you try to enter a colon in the filename, it replaces it with a dash. Renaming a file in finder to use a colon, gives a message similar to your 'Illegal filename'.