Summary: | [GLIB] Implement hardLinkOrCopyFile() in FileSystemGlib | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||||
Component: | Platform | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bugs-noreply | ||||||
Priority: | P2 | Keywords: | Gtk | ||||||
Version: | WebKit Local Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Carlos Garcia Campos
2016-06-07 03:41:00 PDT
Created attachment 280689 [details]
Patch
Comment on attachment 280689 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=280689&action=review Informally reviewed. LGTM with a nit. > Source/WebCore/platform/glib/FileSystemGlib.cpp:385 > + if (!link(sourceFilename.get(), destinationFilename.get())) In Windows the CreateHardLink() function could be used here instead of always copying the file (though it only works in NTFS, see: https://msdn.microsoft.com/en-us/library/windows/desktop/aa363860(v=vs.85).aspx), so please add a TODO comment here to let developers working in Windows that they may want to add the relevant code in the future. Created attachment 280694 [details]
Patch
Add windows implementation too (copied from FileSystemWin.cpp and untested).
Comment on attachment 280694 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=280694&action=review > Source/WebCore/platform/glib/FileSystemGlib.cpp:394 > + return g_file_copy(sourceFile.get(), destinationFile.get(), G_FILE_COPY_NONE, nullptr, nullptr, nullptr, nullptr); Probably should use G_FILE_COPY_OVERWRITE instead of G_FILE_COPY_NONE? (In reply to comment #4) > Comment on attachment 280694 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=280694&action=review > > > Source/WebCore/platform/glib/FileSystemGlib.cpp:394 > > + return g_file_copy(sourceFile.get(), destinationFile.get(), G_FILE_COPY_NONE, nullptr, nullptr, nullptr, nullptr); > > Probably should use G_FILE_COPY_OVERWRITE instead of G_FILE_COPY_NONE? I don't think so, this is a fallback for link, and link fails if destination exists. I think the posix implementation also fails if destination exists. Committed r201796: <http://trac.webkit.org/changeset/201796> |