Steps to reproduce:
- PS 5.1
- No trailing slash for the -FolderPath value
Root cause:
The formula in FileNameHelper.cs targets a result of exactly 260 characters. Win32 MAX_PATH = 260 includes the null terminator, so the actual maximum safe path string is 259 characters.
Get-IshDocumentObjData : Could not find a part of the path 'C:\temp\LongTitleAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=GUID-96F7B1D4-1BE5-41A3-BFDF-C34CDB4B4F37=1=en=.xml'.
Script for reproducing
# Create topic with a very long FTITLE under General\Temp\topic
$ditaTopicFileContent = @"
<?xml version="1.0" ?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic><title>Enter the title of your topic here.<?ish-replace-title?></title><body><p>Bug repro topic.</p></body></topic>
"@
$ishTempFolder = Get-IshFolder -IshSession $ishSession -FolderPath "\General\Temp\topic"
$ishMetadata = Set-IshMetadataField -IshSession $ishSession -Name "FTITLE" -Level Logical -Value ("LongTitle" + ("A" * 260)) |
Set-IshMetadataField -IshSession $ishSession -Name "FAUTHOR" -Level Lng -ValueType Element -Value "VUSERADMIN" |
Set-IshMetadataField -IshSession $ishSession -Name "FSTATUS" -Level Lng -ValueType Element -Value "VSTATUSDRAFT"
$ishObject = Add-IshDocumentObj -IshSession $ishSession -FolderId $ishTempFolder.IshFolderRef -IshType ISHModule -Lng "VLANGUAGEEN" -Edt "EDTXML" -Metadata $ishMetadata -FileContent $ditaTopicFileContent
Write-Host "Created topic LogicalId[$($ishObject.IshRef)]"
$requestedMeta = Set-IshRequestedMetadataField -IshSession $ishSession -Name "FTITLE" -Level Logical |
Set-IshRequestedMetadataField -IshSession $ishSession -Name "VERSION" -Level Version |
Set-IshRequestedMetadataField -IshSession $ishSession -Name "DOC-LANGUAGE" -Level Lng
$fileList = Get-IshDocumentObj -IshSession $ishSession -LogicalId $ishObject.IshRef -RequestedMetadata $requestedMeta |
Get-IshDocumentObjData -IshSession $ishSession -FolderPath "C:\temp"
Write-Host "Downloaded: $($fileList.FullName)"
# Cleanup
Remove-IshDocumentObj -IshSession $ishSession -IshObject $ishObject -Force
Write-Host "Removed topic LogicalId[$($ishObject.IshRef)]"
Steps to reproduce:
Root cause:
The formula in FileNameHelper.cs targets a result of exactly 260 characters. Win32 MAX_PATH = 260 includes the null terminator, so the actual maximum safe path string is 259 characters.
Get-IshDocumentObjData : Could not find a part of the path 'C:\temp\LongTitleAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=GUID-96F7B1D4-1BE5-41A3-BFDF-C34CDB4B4F37=1=en=.xml'.Script for reproducing