@@ -1423,4 +1423,37 @@ DllUnregisterServer.
14231423
14241424=back
14251425
1426+ =head1 CAVEATS
1427+
1428+ =head2 Short Path Names
1429+
1430+ There are many situations in which modern Windows systems will not have
1431+ the L<short path name|https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#short-vs-long-names>
1432+ (also called 8.3 or MS-DOS) alias for long file names available.
1433+
1434+ Short path support can be configured system-wide via the registry,
1435+ but the default on modern systems is to configure short path usage per
1436+ volume. The configuration for a volume can be queried in a number of ways,
1437+ but these may either be unreliable or require elevated (administrator)
1438+ privileges.
1439+
1440+ Typically, the configuration for a volume can be queried using the C<fsutil >
1441+ utility, e.g. C<fsutil 8dot3name query d: > . On the C level, it can be queried
1442+ with a C<FSCTL_QUERY_PERSISTENT_VOLUME_STATE > request to the
1443+ C<DeviceIOControl > API call, as described in
1444+ L<this article|https://www.codeproject.com/Articles/304374/Query-Volume-Setting-for-State-Windows> .
1445+ However, both of these methods require administrator privileges to work.
1446+
1447+ The Win32 module does not perform any per-volume check and simply fetches
1448+ short path names in the same manner as the underlying Windows API call it
1449+ uses: If short path names are disabled, the call will still succeed but the
1450+ long name will actually be returned.
1451+
1452+ Note that on volumes where this happens, C<GetANSIPathName > usually cannot be
1453+ used to return useful filenames for files that contain unicode characters.
1454+ (In code page 65001, this may still work.) Handling unicode filenames in this
1455+ legacy manner relies upon C<GetShortPathName > returning 8.3 filenames, but
1456+ without short name support, it will return the filename with all unicode
1457+ characters replaced by question mark characters.
1458+
14261459=cut
0 commit comments