04
Mon, Nov
5 New Articles

Using Long File Names in a Mixed Environment

General
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

With the introduction of Windows NT and Windows 95, Microsoft has finally given PC users something that has been on available on other platforms for years—the ability to use long file names. Both Windows 95 and NT can support long file names on existing file allocation table (FAT) partitions, which can be an incredible plus for anyone who works on these platforms. Files are no longer limited to an eight-character name followed by a three- character extension (8.3). Instead of using cryptic names such as 1QSLREG1.XLS, PC users can give files meaningful names such as First Quarter Sales Report by Region (Version 1).XLS. However, in the mixed environments found in most MIS departments today, long file names can create almost as many new problems as they solve. Knowing the rules for using long file names can prevent many of the headaches they might cause, while still allowing users to fully benefit from this new technology.

Considerations When Creating Long File Names

Long file names are available only on Windows 95 and NT, which can cause difficulties in MIS departments where Windows 3.1 PCs are also used and in companies that are incrementally upgrading their PCs. Further complicating the issue is the fact that each operating system supports long file names on different file systems. As shown in Figure 1, Windows 95 only supports it on the FAT file system, while Windows NT can support long file names on FAT, High Performance File System (HPFS), or New Technology File System (NTFS), each of which has slightly different rules governing the length of names and the characters allowed. In the event that a mixed environment is not acceptable, both Windows 95 and NT can be forced into using the Windows 3.1 version of FAT. Changing the Registry Key

HKEY_LOCAL_MACHINESystem CurrentControlSetControl


FileSystemWin31FileSystem

to 1 will enable the older FAT system and will disable long file name support.

Those people who decide to keep long file name support will need to understand the rules for creating a long file name. Any file or directory may be given a long name, although care must be given to not to exceed the limitations on the number and type of characters allowed. There are several rules for creating a long file name.

• On FAT partitions, all numbers and characters are allowed, including spaces and excluding these characters: ? “ / [ ] * | : ; = ^ ,

• On NTFS and HPFS partitions, all numbers and characters are allowed, including spaces and excluding these characters: ? “ / < > * | :

• Multiple periods are allowed in the name, with the extension being the characters after the last period.

• On FAT and NTFS partitions, long file names or directory names can be up to 255 characters.

• On HPFS partitions, long file names can be up to 254 characters.
• All partition types will maintain the case of the long file name, but none of them are case-sensitive. For example, moving a file called Current Readme.txt to a directory will overwrite the CURRENT README.TXT already in that directory, but now it will appear as Current Readme.txt in the directory listing.

Even if you follow all the rules in creating long file names, they can still cause problems when used on a FAT partition. The FAT file system was originally designed to store each 8.3 file name in a separate directory entry. Now it must contend with up to 255 characters per file name, plus an automatically generated 8.3 alias for the same file. (I will go into that caveat more later.) FAT handles this problem by using one directory entry for every thirteen characters of the long file name and an additional entry for the 8.3 alias. For example, a file called Memo to Bank Regarding Account.doc would use three directory entries for the long file name and one more for its alias. This can be critical in the root directory, which has a hardcoded limit of 512 directory entries. The moral here is to keep your root directory free of extraneous files, especially those with long file names. Long file names can also cause a problem for older disk utilities, many of which will report the extra directory entries as lost or corrupt files. Be sure to only use disk utilities designed for Windows 95 or Windows NT in order to prevent these problems.

Backwards Compatibility for Applications: The 8.3 Alias

Are Windows 3.1 and DOS users and applications prevented from using files with long file names? Microsoft obviously has a large stake in maintaining backwards compatibility with its previous operating systems and the applications created for them, and has taken steps to ensure that the new long file names can be used from these older platforms. Both Windows 95 and Windows NT generate an 8.3-compatible alias for a long file name, using a standard algorithm. Under this scheme, the first six digits of a long file name are retained, excluding any spaces, extra periods, and illegal characters. After this, the algorithm places a tilde (~) and the number one (1), followed by the original extension truncated to three digits. Finally, the name is converted to uppercase letters. The same procedure is used for the next three files in the same directory that have the same first six digits in their names, except that the number is incremented for each file, as seen in Figure
2. With the fifth similar file name, the alias algorithm retains only the first two characters of the original long file name, and appends four randomly generated characters, followed by the tilde and the number five. All additional files will have four different middle characters. When one of the random generations finally duplicates an existing file name,


the number after the tilde will be incremented again, and so on. However, at this point it would probably be advisable to come up with a new naming scheme.

Typing in the DIR command from a Windows 95 command prompt will display both the long file name and its automatically generated counterpart. From a Windows NT 3.51 or 4.0 command prompt, it is necessary to enter DIR /X to see the same information. If you are working on a Windows NT machine with NTFS partitions and are in an environment where all computers and applications can support long file names, it is possible to disable the alias algorithm. Changing the Registry Key

HKEY_LOCAL_MACHINE
SystemCurrentControlSet
ControlFileSystemNtfs
Disable8dot3NameCreation

to 1 will stop the generation of aliases. Most IS departments still support mixed platforms, including both Windows 3.1 and Windows NT or 95. In addition, there always seems to be that one legacy DOS application that the business must have to survive. Whatever the reason, eventually you will most likely have to use an older application to open a file with a long file name. Knowing how Windows creates an alias for each file is a start, but it also helps to know how older applications and partitions will behave when faced with a long file name.

Sixteen-bit applications will always use the 8.3 alias when working with files. This is the name that will be displayed in all dialog boxes and messages. Any long directory names will also appear in their shortened version. If a 16-bit application opens an existing file with a long file name and saves it with the same name, the existing long file name will be preserved on the network drive. However, if the file is to be saved in a new location or if a new file is created, it will only have an 8.3 name. Of course, the easiest solution is to upgrade all applications to the latest 32-bit versions, which have native long file name support, although this will not make you very popular with the accounting department.

The Windows 95 and NT command prompts also require some special treatment of long file names, especially when copying files to older computers. Any commands typed in at the Windows 95 or NT command prompts will require that the long file names be entered in quotes, or that the alias be used in the command. For example, Figure 3 shows the correct syntax for two commands that will have the same result. When using COPY or XCOPY to transfer files to a FAT partition that doesn’t support long file names, the /N switch will copy the files using the generated short names. It is important to note that this same command will not work when copying from an HPFS partition to an older FAT partition, as HPFS does not generate the short file name alias.

Long file names finally enable computers to name objects in the same manner that people have for years. In spite of the potential pitfalls, the additional clarity of the long names makes them worthwhile. If you happen to work in a mixed environment, you can use short names or aliases for those files that must be used by systems that can’t handle a long file name, while still using the longer names on systems that support them. Long file names can be addictive, though. Once you become used to working with long file names, you won’t want to go back to the world of 8 dot 3.

References

Support Fundamentals for Microsoft Windows NT, Microsoft Press, 1995 Windows NT Resource Kit, Microsoft Press, 1995


Using_Long_File_Names_in_a_Mixed_Environment04-00.jpg 450x97

Figure 1: Operating System Support for Long File Names Figure 2: Long File Names and Their Aliases Figure 3: Using Long File Names from a Command Prompt


Using_Long_File_Names_in_a_Mixed_Environment04-01.jpg 450x176

Using_Long_File_Names_in_a_Mixed_Environment04-02.jpg 450x52

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: