Unexpected behavior from cygpath command

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Thu Nov 14 05:22:00 GMT 2019


On 2019-11-13 11:29, Alfred von Campe wrote:
> On Nov 13, 2019, at 2:08, Frank Redeker wrote:
> 
>> I think on both systems the handling of 8.3 names is configured
>> differently. You can check this with the Window command fsutil. (This
>> command requires elevated permissions)
>>
>> I get the following output on my system.
>>
>> C:\WINDOWS\system32>fsutil 8dot3name query d:
>> The volume state is: 0 (8dot3 name creation is enabled).
>> The registry state is: 2 (Per volume setting - the default).
> 
> Thanks, I think this is very interesting, I did not know that such a setting
>  existed. It was indeed disabled for my E: drive. However, after enabling it 
> I still can’t get “cygpath -d" to work as expected. This setting also doesn’t
> explain why cygpath returns the correct DOS path when I pass it in a Unix
> style path instead of a Windows style path.

I have found that there is something different about cygpath that behaves less
consistently when used between `backquotes` than $(command quotes).

Have you tried forcing short names with -s, --short-name: -ds or -ws to see if
those help? If those don't, try adding -a, --absolute: -ads -aws to see if that
makes a difference.

Check the drive file system from an elevated command prompt, and save the
output, reboot, recheck, compare the output to see if anything differs, and
retest, to see if anything changes:

> fsutil fsinfo drivetype e:
e: - Fixed Drive

> fsutil fsinfo volumeinfo e:
Volume Name : ...
Volume Serial Number : 0x6b8d438
Max Component Length : 255
File System Name : NTFS
Is ReadWrite
Not Thinly-Provisioned
Supports Case-sensitive filenames
Preserves Case of filenames
Supports Unicode in filenames
Preserves & Enforces ACL's
Supports file-based Compression
Supports Disk Quotas
Supports Sparse files
Supports Reparse Points
Returns Handle Close Result Information
Supports POSIX-style Unlink and Rename
Supports Object Identifiers
Supports Encrypted File System
Supports Named Streams
Supports Transactions
Supports Hard Links
Supports Extended Attributes
Supports Open By FileID
Supports USN Journal

> fsutil fsinfo ntfsinfo e:
NTFS Volume Serial Number :        0x80ffb5d906b8d438
NTFS Version   :                   3.1
LFS Version    :                   2.0
Number Sectors :                   0x00000000744bc466
Total Clusters :                   0x000000000e89788c
Free Clusters  :                   0x0000000009817c24
Total Reserved :                   0x0000000000008bf7
Bytes Per Sector  :                512
Bytes Per Physical Sector :        4096
Bytes Per Cluster :                4096
Bytes Per FileRecord Segment    :  1024
Clusters Per FileRecord Segment :  0
Mft Valid Data Length :            0x00000000ef640000
Mft Start Lcn  :                   0x00000000000ad74c
Mft2 Start Lcn :                   0x0000000000000002
Mft Zone Start :                   0x0000000005f1ef40
Mft Zone End   :                   0x0000000005f28fc0
Max Device Trim Extent Count :     0
Max Device Trim Byte Count :       0x0
Max Volume Trim Extent Count :     62
Max Volume Trim Byte Count :       0x40000000
Resource Manager Identifier :      99B60DE5-842F-11E1-98AF-D71846560B56

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list