[Webkit-unassigned] [Bug 194344] [WTF] Add getting/changing current working directory to FileSystem

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Feb 10 13:56:59 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=194344

--- Comment #9 from Stephan Szabo <stephan.szabo at sony.com> ---
(In reply to Darin Adler from comment #8)
> Comment on attachment 361404 [details]
> Add get/change current working directory functions, fix a few issues
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=361404&action=review
> 
> I’d like to see the one first use of this in JSC in the same patch as
> introducing it. Not a huge fan of adding something unused to WTF.

Okay, will make up a version with the JSC stuff as well.

> > Source/WTF/wtf/glib/FileSystemGlib.cpp:470
> > +    GUniquePtr<char> currentDir(g_get_current_dir());
> 
> When does this give a different value than getcwd?

It appears that it does something different on Windows and elsewhere will do some extra things with the PWD environment variable if this is correct: https://github.com/GNOME/glib/blob/master/glib/gfileutils.c#L2683
Specifically, it seems like it may handle some link cases different by comparing the device and inode of PWD and "." and using the value in PWD rather than what would be given by getcwd if they're the same?

> > Source/WTF/wtf/glib/FileSystemGlib.cpp:477
> > +    return !chdir(fsRep.data());
> 
> This is the same as the POSIX one. Maybe we can rearrange things so we don’t
> have two copies. Does this even work when glib is running on Windows?

It probably would, but I think they've marked it as deprecated. While looking up the above it seems like the glib get function is doing windows specific stuff, so it probably should actually use SetCurrentDirectoryW on Windows instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190210/90ebc3e9/attachment.html>


More information about the webkit-unassigned mailing list