

Output paths will be converted back ( denormalized) to a UTF-8 fullpath that begins with a drive letter or UNC. The Microsoft specification still limits the directory component to MAX_PATH (about 255) characters. This allows paths to be up to 32,767 characters long and to include Unicode characters. UNC: The path can begin with a UNC path in the form \\server\share or //server/share.Įxtended-length: The path can begin with an extended-length prefix in the form of \\?\ or //?/.Īll input paths will be converted ( normalized) to a fullpath using the extended-length format and wide characters. For example, C:/path (fullpath) or c:path (relative path). See perlunicode for more information on using Unicode with Perl.ĭrive letter: The path can begin with an upper or lower case letter from A to Z followed by a colon to indicate a drive letter path.

If Unicode is used, the string must be internally identified as UTF-8. Unicode: Unicode characters can be used anywhere in the path provided they are supported by the Windows file naming standard. Path separators: Both the forward (/) and reverse (\) slashes can be used to separate the path components. Pathsįile and directory paths can be provided containing any of the following components. Some additional functions are also available to provide low-level features that are specific to Windows files.

These functions attempt to imitate the native functionality and format as closely as possible and accept file paths which include Unicode characters and can be up to 32,767 characters long. Win32::LongPath provides replacement functions for most of the native Perl file functions. The end result is that you can process any file in the Windows environment without worrying about Unicode or path length. Win32::LongPath overcomes these limitations by using Windows wide-character functions which support Unicode and extended-length paths. greater than the Windows MAX_PATH value which is about 255 characters). RmdirL ($path) or die "unable to remove $path ($^E)" Īlthough Perl natively supports functions that can access files in Windows these functions fail for Unicode or long file paths (i.e. UnlinkL ($file) or die "unable to delete file ($^E)" Print $FH "writing some more Unicode characters\n" While (length ($path) :encoding(UTF-8)', $file) # make a really long path w/Unicode from around the world Win32::LongPath - provide functions to access long paths and Unicode in the Windows environment SYNOPSIS use File::Spec::Functions
