Files
sparkle-project.github.io/documentation/api-reference/interface_s_u_file_manager.html
T
2021-09-03 19:38:30 -07:00

553 lines
30 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Sparkle: SUFileManager Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="icon_32x32@2x.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Sparkle
&#160;<span id="projectnumber">2.0.0</span>
</div>
<div id="projectbrief">A software update framework for macOS</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Instance Methods</a> &#124;
<a href="interface_s_u_file_manager-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">SUFileManager Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#import &lt;<a class="el" href="_s_u_file_manager_8h_source.html">SUFileManager.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for SUFileManager:</div>
<div class="dyncontent">
<div class="center">
<img src="interface_s_u_file_manager.png" alt=""/>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Instance Methods</h2></td></tr>
<tr class="memitem:a972da7c2fb112d09d4903ada3564126a"><td class="memItemLeft" align="right" valign="top">(instancetype)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_s_u_file_manager.html#a972da7c2fb112d09d4903ada3564126a">init</a></td></tr>
<tr class="separator:a972da7c2fb112d09d4903ada3564126a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a055d2ef9910e85c90a7d0dc34b34ce92"><td class="memItemLeft" align="right" valign="top">(NSURL *_Nullable)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_s_u_file_manager.html#a055d2ef9910e85c90a7d0dc34b34ce92">makeTemporaryDirectoryWithPreferredName:appropriateForDirectoryURL:error:</a></td></tr>
<tr class="separator:a055d2ef9910e85c90a7d0dc34b34ce92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace4c529974dc1b64360db12689c2e9aa"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_s_u_file_manager.html#ace4c529974dc1b64360db12689c2e9aa">makeDirectoryAtURL:error:</a></td></tr>
<tr class="separator:ace4c529974dc1b64360db12689c2e9aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f9d15f622a08284e2d5157ebea440f3"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_s_u_file_manager.html#a8f9d15f622a08284e2d5157ebea440f3">moveItemAtURL:toURL:error:</a></td></tr>
<tr class="separator:a8f9d15f622a08284e2d5157ebea440f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec3de47f6e37353f905b855951b37c65"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_s_u_file_manager.html#aec3de47f6e37353f905b855951b37c65">replaceItemAtURL:withItemAtURL:error:</a></td></tr>
<tr class="separator:aec3de47f6e37353f905b855951b37c65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac33297bd6dfbf11a23c3c0ded059f4d0"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_s_u_file_manager.html#ac33297bd6dfbf11a23c3c0ded059f4d0">copyItemAtURL:toURL:error:</a></td></tr>
<tr class="separator:ac33297bd6dfbf11a23c3c0ded059f4d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aea79ee52a31937c33f5e00e60f873b4b"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_s_u_file_manager.html#aea79ee52a31937c33f5e00e60f873b4b">removeItemAtURL:error:</a></td></tr>
<tr class="separator:aea79ee52a31937c33f5e00e60f873b4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af0defc82017c43bd1f0eab5540c05f09"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_s_u_file_manager.html#af0defc82017c43bd1f0eab5540c05f09">changeOwnerAndGroupOfItemAtRootURL:toMatchURL:error:</a></td></tr>
<tr class="separator:af0defc82017c43bd1f0eab5540c05f09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad81e3246bf42d50c7c0ed2df06ff41de"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_s_u_file_manager.html#ad81e3246bf42d50c7c0ed2df06ff41de">updateModificationAndAccessTimeOfItemAtURL:error:</a></td></tr>
<tr class="separator:ad81e3246bf42d50c7c0ed2df06ff41de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7b47ef3936d2ab36d32d1f496c9b133"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_s_u_file_manager.html#ae7b47ef3936d2ab36d32d1f496c9b133">updateAccessTimeOfItemAtRootURL:error:</a></td></tr>
<tr class="separator:ae7b47ef3936d2ab36d32d1f496c9b133"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8599b8160422edbb38f34e547889f727"><td class="memItemLeft" align="right" valign="top">(BOOL)&#160;</td><td class="memItemRight" valign="bottom">- <a class="el" href="interface_s_u_file_manager.html#a8599b8160422edbb38f34e547889f727">releaseItemFromQuarantineAtRootURL:error:</a></td></tr>
<tr class="separator:a8599b8160422edbb38f34e547889f727"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A class used for performing file operations more suitable than NSFileManager for performing installation work. All operations on this class may be used on thread other than the main thread. This class provides just basic file operations and stays away from including much application-level logic. </p>
</div><h2 class="groupheader">Method Documentation</h2>
<a id="af0defc82017c43bd1f0eab5540c05f09"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af0defc82017c43bd1f0eab5540c05f09">&#9670;&nbsp;</a></span>changeOwnerAndGroupOfItemAtRootURL:toMatchURL:error:</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) changeOwnerAndGroupOfItemAtRootURL: </td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>targetURL</em></td>
</tr>
<tr>
<td class="paramkey">toMatchURL:</td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>matchURL</em></td>
</tr>
<tr>
<td class="paramkey">error:</td>
<td></td>
<td class="paramtype">(NSError **)&#160;</td>
<td class="paramname"><em>error</em>&#160;</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Changes the owner and group IDs of an item at a specified target URL to match another URL </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">targetURL</td><td>A URL pointing to the target item whose owner and group IDs to alter. This will be applied recursively if the item is a directory. The item at this URL must exist. </td></tr>
<tr><td class="paramname">matchURL</td><td>A URL pointing to the item whose owner and group IDs will be used for changing on the targetURL. The item at this URL must exist. </td></tr>
<tr><td class="paramname">error</td><td>If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>YES if the target item's owner and group IDs have changed to match the origin's ones, otherwise NO along with a populated error object</dd></dl>
<p>If the owner and group IDs match on the root items of targetURL and matchURL, this method stops and assumes that nothing needs to be done. Otherwise this method recursively changes the IDs if the target is a directory. If an item in the directory is encountered that is unable to be changed, then this method stops and returns NO. While this method will try to change the group ID, being unable to change the group ID does not result in a failure if the owner ID can be changed or matched.</p>
<p>This is not an atomic operation. </p>
</div>
</div>
<a id="ac33297bd6dfbf11a23c3c0ded059f4d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac33297bd6dfbf11a23c3c0ded059f4d0">&#9670;&nbsp;</a></span>copyItemAtURL:toURL:error:</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) copyItemAtURL: </td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>sourceURL</em></td>
</tr>
<tr>
<td class="paramkey">toURL:</td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>destinationURL</em></td>
</tr>
<tr>
<td class="paramkey">error:</td>
<td></td>
<td class="paramtype">(NSError **)&#160;</td>
<td class="paramname"><em>error</em>&#160;</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Copies an item from a source to a destination </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">sourceURL</td><td>A URL pointing to the item to move. The item at this URL must exist. </td></tr>
<tr><td class="paramname">destinationURL</td><td>A URL pointing to the destination the item will be moved at. An item must not already exist at this URL. </td></tr>
<tr><td class="paramname">error</td><td>If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>YES if the item was copied successfully, otherwise NO along with a populated error object</dd></dl>
<p>This is not an atomic operation. </p>
</div>
</div>
<a id="a972da7c2fb112d09d4903ada3564126a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a972da7c2fb112d09d4903ada3564126a">&#9670;&nbsp;</a></span>init</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (instancetype) init </td>
<td></td>
<td class="paramname"></td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">{</div>
<div class="line"> NSFileManager *_fileManager</div>
</div><!-- fragment --><p>Initializes a new file manager</p>
<dl class="section return"><dt>Returns</dt><dd>A new file manager instance </dd></dl>
</div>
</div>
<a id="ace4c529974dc1b64360db12689c2e9aa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ace4c529974dc1b64360db12689c2e9aa">&#9670;&nbsp;</a></span>makeDirectoryAtURL:error:</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) makeDirectoryAtURL: </td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>targetURL</em></td>
</tr>
<tr>
<td class="paramkey">error:</td>
<td></td>
<td class="paramtype">(NSError **)&#160;</td>
<td class="paramname"><em>error</em>&#160;</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a directory at the target URL </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">targetURL</td><td>A URL pointing to the directory to create. The item at this URL must not exist, and the parent directory of this URL must already exist. </td></tr>
<tr><td class="paramname">error</td><td>If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>YES if the item was created successfully, otherwise NO along with a populated error object</dd></dl>
<p>This is an atomic operation. </p>
</div>
</div>
<a id="a055d2ef9910e85c90a7d0dc34b34ce92"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a055d2ef9910e85c90a7d0dc34b34ce92">&#9670;&nbsp;</a></span>makeTemporaryDirectoryWithPreferredName:appropriateForDirectoryURL:error:</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (NSURL *) makeTemporaryDirectoryWithPreferredName: </td>
<td></td>
<td class="paramtype">(NSString *)&#160;</td>
<td class="paramname"><em>preferredName</em></td>
</tr>
<tr>
<td class="paramkey">appropriateForDirectoryURL:</td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>appropriateURL</em></td>
</tr>
<tr>
<td class="paramkey">error:</td>
<td></td>
<td class="paramtype">(NSError * __autoreleasing *)&#160;</td>
<td class="paramname"><em>error</em>&#160;</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a temporary directory on the same volume as a provided URL </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">preferredName</td><td>A name that may be used when creating the temporary directory. Note that in the uncothirdStageErrormmon case this name is used, the temporary directory will be created inside the directory pointed by appropriateURL </td></tr>
<tr><td class="paramname">appropriateURL</td><td>A URL to a directory that resides on the volume that the temporary directory will be created on. In the uncommon case, the temporary directory may be created inside this directory. </td></tr>
<tr><td class="paramname">error</td><td>If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A URL pointing to the newly created temporary directory, or nil with a populated error object if an error occurs.</dd></dl>
<p>When moving an item from a source to a destination, it is desirable to create a temporary intermediate destination on the same volume as the destination to ensure that the item will be moved, and not copied, from the intermediate point to the final destination. This ensures file atomicity. </p>
</div>
</div>
<a id="a8f9d15f622a08284e2d5157ebea440f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f9d15f622a08284e2d5157ebea440f3">&#9670;&nbsp;</a></span>moveItemAtURL:toURL:error:</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) moveItemAtURL: </td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>sourceURL</em></td>
</tr>
<tr>
<td class="paramkey">toURL:</td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>destinationURL</em></td>
</tr>
<tr>
<td class="paramkey">error:</td>
<td></td>
<td class="paramtype">(NSError **)&#160;</td>
<td class="paramname"><em>error</em>&#160;</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Moves an item from a source to a destination </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">sourceURL</td><td>A URL pointing to the item to move. The item at this URL must exist. </td></tr>
<tr><td class="paramname">destinationURL</td><td>A URL pointing to the destination the item will be moved at. An item must not already exist at this URL. </td></tr>
<tr><td class="paramname">error</td><td>If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>YES if the item was moved successfully, otherwise NO along with a populated error object</dd></dl>
<p>If sourceURL and destinationURL reside on the same volume, this operation will be an atomic move operation. Otherwise this will be equivalent to a copy &amp; remove which will be a nonatomic operation. </p>
</div>
</div>
<a id="a8599b8160422edbb38f34e547889f727"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8599b8160422edbb38f34e547889f727">&#9670;&nbsp;</a></span>releaseItemFromQuarantineAtRootURL:error:</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) releaseItemFromQuarantineAtRootURL: </td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>rootURL</em></td>
</tr>
<tr>
<td class="paramkey">error:</td>
<td></td>
<td class="paramtype">(NSError **)&#160;</td>
<td class="paramname"><em>error</em>&#160;</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Releases Apple's quarantine extended attribute from the item at the specified root URL </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">rootURL</td><td>A URL pointing to the item to release from Apple's quarantine. This will be applied recursively if the item is a directory. The item at this URL must exist. </td></tr>
<tr><td class="paramname">error</td><td>If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>YES if all the items at the target could be released from quarantine, otherwise NO if any items couldn't along with a populated error object</dd></dl>
<p>This method removes quarantine attributes from an item, ideally an application, so that when the user launches a new application themselves, they don't have to witness the system dialog alerting them that they downloaded an application from the internet and asking if they want to continue. Note that this may not exactly mimic the system behavior when a user opens an application for the first time (i.e, the xattr isn't deleted), but this should be sufficient enough for our purposes.</p>
<p>This method may return NO even if some items do get released from quarantine if the target URL is pointing to a directory. Thus if an item cannot be released from quarantine, this method still continues on to the next enumerated item.</p>
<p>This is not an atomic operation. </p>
</div>
</div>
<a id="aea79ee52a31937c33f5e00e60f873b4b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aea79ee52a31937c33f5e00e60f873b4b">&#9670;&nbsp;</a></span>removeItemAtURL:error:</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) removeItemAtURL: </td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>url</em></td>
</tr>
<tr>
<td class="paramkey">error:</td>
<td></td>
<td class="paramtype">(NSError **)&#160;</td>
<td class="paramname"><em>error</em>&#160;</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Removes an item at a URL </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">url</td><td>A URL pointing to the item to remove. The item at this URL must exist. </td></tr>
<tr><td class="paramname">error</td><td>If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>YES if the item was removed successfully, otherwise NO along with a populated error object</dd></dl>
<p>This is not an atomic operation. </p>
</div>
</div>
<a id="aec3de47f6e37353f905b855951b37c65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aec3de47f6e37353f905b855951b37c65">&#9670;&nbsp;</a></span>replaceItemAtURL:withItemAtURL:error:</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) replaceItemAtURL: </td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>originalItemURL</em></td>
</tr>
<tr>
<td class="paramkey">withItemAtURL:</td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>newItemURL</em></td>
</tr>
<tr>
<td class="paramkey">error:</td>
<td></td>
<td class="paramtype">(10.13)&#160;</td>
<td class="paramname"><em>__OSX_AVAILABLE</em>&#160;</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Replaces an original item with a new item atomically. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">originalItemURL</td><td>A URL pointing to the original item to replace. The item at this URL must exist. </td></tr>
<tr><td class="paramname">newItemURL</td><td>A URL pointing to the new item that will replace the original item. </td></tr>
<tr><td class="paramname">error</td><td>If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>YES if the original item was replaced with the new item successfully, otherwise NO along with a populated error object</dd></dl>
<p>originalItemURL and newItemURL must reside on the same volume. If the operation succeeds, this will be be an atomic operation. Otherwise on failure you may need to re-try using move operations. This operation will fail on non-apfs volumes or volumes that don't support rename swapping. Both originalItemURL and newItemURL must exist. </p>
</div>
</div>
<a id="ae7b47ef3936d2ab36d32d1f496c9b133"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae7b47ef3936d2ab36d32d1f496c9b133">&#9670;&nbsp;</a></span>updateAccessTimeOfItemAtRootURL:error:</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) updateAccessTimeOfItemAtRootURL: </td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>targetURL</em></td>
</tr>
<tr>
<td class="paramkey">error:</td>
<td></td>
<td class="paramtype">(NSError * __autoreleasing *)&#160;</td>
<td class="paramname"><em>error</em>&#160;</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Updates the access time of an item at a specified root URL to the current time </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">targetURL</td><td>A URL pointing to the target item whose access time to update to the current time. This will be applied recursively if the item is a directory. The item at this URL must exist. </td></tr>
<tr><td class="paramname">error</td><td>If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>YES if the target item's access times have been updated, otherwise NO along with a populated error object</dd></dl>
<p>This method updates the access time of an item to the current time, ideal for letting the system know not to remove a file or directory when placing it at a temporary directory.</p>
<p>This is not an atomic operation. </p>
</div>
</div>
<a id="ad81e3246bf42d50c7c0ed2df06ff41de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad81e3246bf42d50c7c0ed2df06ff41de">&#9670;&nbsp;</a></span>updateModificationAndAccessTimeOfItemAtURL:error:</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">- (BOOL) updateModificationAndAccessTimeOfItemAtURL: </td>
<td></td>
<td class="paramtype">(NSURL *)&#160;</td>
<td class="paramname"><em>targetURL</em></td>
</tr>
<tr>
<td class="paramkey">error:</td>
<td></td>
<td class="paramtype">(NSError **)&#160;</td>
<td class="paramname"><em>error</em>&#160;</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Updates the modification and access time of an item at a specified target URL to the current time </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">targetURL</td><td>A URL pointing to the target item whose modification and access time to update. The item at this URL must exist. </td></tr>
<tr><td class="paramname">error</td><td>If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>YES if the target item's modification and access times have been updated, otherwise NO along with a populated error object</dd></dl>
<p>This method updates the modification and access time of an item to the current time, ideal for letting the system know we installed a new file or application.</p>
<p>This is not an atomic operation. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>Sparkle/<a class="el" href="_s_u_file_manager_8h_source.html">SUFileManager.h</a></li>
<li>Sparkle/SUFileManager.m</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>