Exemple #1
0
        /// <summary>
        /// Deletes the given path whether it's a file or a directory. If |path| is a
        /// directory all contents will be deleted.  If |recursive| is true (1) any sub-
        /// directories and their contents will also be deleted (equivalent to executing
        /// "rm -rf", so use with caution). On POSIX environments if |path| is a symbolic
        /// link then only the symlink will be deleted. Returns true (1) on successful
        /// deletion or if |path| does not exist. Calling this function on the browser
        /// process UI or IO threads is not allowed.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_file_util_capi.h">cef/include/capi/cef_file_util_capi.h</see>.
        /// </remarks>
        public static bool DeleteFile(string path, bool recursive)
        {
            var call = new CfxRuntimeDeleteFileRemoteCall();

            call.path      = path;
            call.recursive = recursive;
            call.RequestExecution();
            return(call.__retval);
        }
Exemple #2
0
        /// <summary>
        /// Deletes the given path whether it's a file or a directory. If |path| is a
        /// directory all contents will be deleted.  If |recursive| is true (1) any sub-
        /// directories and their contents will also be deleted (equivalent to executing
        /// "rm -rf", so use with caution). On POSIX environments if |path| is a symbolic
        /// link then only the symlink will be deleted. Returns true (1) on successful
        /// deletion or if |path| does not exist. Calling this function on the browser
        /// process UI or IO threads is not allowed.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_file_util_capi.h">cef/include/capi/cef_file_util_capi.h</see>.
        /// </remarks>
        public static bool DeleteFile(string path, bool recursive)
        {
            var connection = CfxRemoteCallContext.CurrentContext.connection;
            var call       = new CfxRuntimeDeleteFileRemoteCall();

            call.path      = path;
            call.recursive = recursive;
            call.RequestExecution(connection);
            return(call.__retval);
        }