-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exporting long paths #268
Comments
Hi, If this is an Umbraco 7 site, i think you can set the |
Thanks for the quick answer @KevinJump . I'll try that. I do depend on the path structure. I migrate the content do new document types at a later stage and I use the path to compare and old structure with old doctypes with new structure with new doctypes. I'll se if I can make it work. |
Okay, that did work and the folders are now id:s. Unfortunately I do need the paths as is. Is there anyway I can enable long paths or do you have any suggestions to solve it? I understand that my issue really is not an issue in most cases. Really appreciate the help! :) |
Hi, if you have done the registry setting that applies to everything on the machine (think it might require a restart). The content will still contain the path (in the file) for when it is imported, but if the names are super long its only the windows setting that can do anything about that. |
Yeah exactly. For some reason I can't get the package to respect the windows registry setting. It works on my machine, tested it manually and on a console app. So I can't figure out why the application does not. I also tried adding a manifest but the I can't seemt to attach it to the packaged .dll:s. |
Is there any way to get hold of the source code for the Packer package |
yes, they live here https://github.com/Jumoo/uSync.Migrations.Packers |
@KevinJump really appreciate your help man! Thx. I just realized that the actual error happens here: Jumoo.uSync.BackOffice.Helpers.uSyncIOHelper.SaveNode(XElement node, String path). Or am I not understanding this correctly? The current uSync package im using is 4.0.16 and that source code is not available right? |
It all ends in a call to the framework method |
@KevinJump I solved my issue by doing this in the SaveNode method in uSyncIOHelper: if (File.Exists(path))
{
ArchiveFile(path);
// remove
// File.Delete(path);
}
string folder = Path.GetDirectoryName(path);
// The prefix \\?\ tells windows to ignore long paths apparently.
string newFolderPath = @"\\?\" + folder;
string newPath = @"\\?\" + path;
//LogHelper.Warn<uSyncEvents>("Folder: {0}", () => newFolderPath);
if (!Directory.Exists(folder))
{
Directory.CreateDirectory(newFolderPath);
}
LogHelper.Debug<uSyncIOHelper>("Saving XML to Disk: {0}", () => path);
uSyncEvents.fireSaving(new uSyncEventArgs { fileName = path });
node.Save(newPath);
uSyncEvents.fireSaved(new uSyncEventArgs { fileName = path }); This might not be a solution for everyone. It actually made some other stuff a bit harder like, zipping files for example. Had to use powershell to zip the folders. But you helped me solve my issue, very much appreciated!! :) |
I have a very long folder path and structure of my site that i'm trying to export and I get this error on some pages:
2024-04-24 16:16:42,087 [P7716/D2/T92] WARN Jumoo.uSync.BackOffice.uSyncEvents - Failed to save node: System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at Jumoo.uSync.BackOffice.Helpers.uSyncIOHelper.SaveNode(XElement node, String path)
2024-04-24 16:16:42,229 [P7716/D2/T92] WARN Jumoo.uSync.BackOffice.uSyncEvents - Failed to save node: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\A{project}\uSync\MigrationPacks{guid}\data\Content\home\positions\position-papers\positions-papers\consultative-document-on-global-systemically-important-banks-assessment-methodology-and-the-additional-loss-absorbency-requirement'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
Im trying to hack my way through using longPathEnabled registry key in windows but I cant seem to get the uSync .dll to respect the flag. Any ideas on what to do?
The text was updated successfully, but these errors were encountered: