[PUP-8257] Puppet::FileSystem::Windows should support LFN Created: 2017/12/15  Updated: 2018/09/26

Status: Open
Project: Puppet
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Jacob Helwig Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PUP-4866 Plug-in Sync Should Use Long File Nam... Accepted
relates to PUP-6152 PMT Should Use Long File Name (LFN) P... Ready for Engineering
Template:
Team: Coremunity
Method Found: Needs Assessment
QA Risk Assessment: Needs Assessment

 Description   

As mentioned in PUP-4866 & PUP-6152, there is support for using long file names greater than 260 characters in Windows by using the "\\?\" prefix.

Unfortunately, this doesn't quite work with Ruby's normal file path handling, as it also uses "/" on Windows as the path separator, and this needs to be converted to "\" for the "\\?\" prefix to work. Because of the requirement to translate "/" to "\" on the final file path for the "\\?\" LFN prefix to work, we should probably be putting the LFN support directly in to Puppet::FileSystem::Windows, and making sure that we are not using the native Ruby file path handling methods (Eg: File.expand_path, File.join, etc.) anywhere, and are using the Puppet::FileSystem versions instead.



 Comments   
Comment by Ethan Brown [ 2018/04/05 ]

If we want to land this in Puppet::FileSystem it might make sense to add to the epic PUP-7557

As much as I hate the idea, this might need to be one place where we monkey-patch Ruby classes to fix broken functionality, because there's a number of 3rd party locations (like in minitar) where we won't be able to change the original gem code.  Food for thought as further work happens here.

Generated at Fri Jun 05 19:28:16 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.