[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1854072 - in /subversion/trunk/subversion: libsvn_subr/io.c tests/libsvn_subr/io-test.c

From: Evgeny Kotkov <evgeny.kotkov_at_visualsvn.com>
Date: Fri, 22 Feb 2019 01:37:56 +0300

Branko Čibej <brane_at_apache.org> writes:

> @@ -4493,6 +4571,12 @@ svn_io_dir_remove_nonrecursive(const cha
>
> SVN_ERR(cstring_from_utf8(&dirname_apr, dirname, pool));
>
> + /* On Windows, a read-only directory cannot be removed. */
> +#if defined(WIN32) || defined(__OS2__)
> + SVN_ERR(io_set_readonly_flag(dirname_apr, dirname,
> + FALSE, FALSE, FALSE, pool));
> +#endif
> +
> status = apr_dir_remove(dirname_apr, pool);

Would it be feasible for us to only attempt to remove the read-only
attribute after receiving an error? (along the lines of the attached patch)

The reason is that getting and setting file attributes usually results in
CreateFile() syscalls, whereas opening files and the I/O-related syscalls are
not cheap on Win32 in general. So changing the directory attributes per every
remove could increase the amount of I/O operations and maybe slow down the
cases where we have to remove multiple directories, with the post-commit
transaction directory cleanup being an example of such case.

Thanks,
Evgeny Kotkov

Received on 2019-02-21 23:43:57 CET

This is an archived mail posted to the Subversion Dev mailing list.