@@ -134,7 +134,7 @@ <h1>php<span class="red">sec</span>lib: SFTP Examples and Notes</h1>
134
134
< option value ="get "> Download File</ option >
135
135
< option value ="dir "> Directory Management</ option >
136
136
< option value ="list "> Directory Listing</ option >
137
- < option value ="chmod " > Change Permissions </ option >
137
+ < option value ="attr " > File Attributes </ option >
138
138
< option value ="stat "> File Information</ option >
139
139
< option value ="delete "> Delete and Rename</ option >
140
140
</ select >
@@ -174,8 +174,15 @@ <h1>php<span class="red">sec</span>lib: SFTP Examples and Notes</h1>
174
174
//$sftp-> delete('test', true);</ span > < span style ="display: none ">
175
175
</ span > < span class ="list "> print_r($sftp-> nlist()); // == $sftp-> nlist('.')
176
176
print_r($sftp-> rawlist()); // == $sftp-> rawlist('.')</ span > < span style ="display: none ">
177
- </ span > < span class ="chmod "> $sftp-> chmod(0777, 'filename.remote');
178
- //$sftp-> chmod(0777, 'dirname.remote', true); // recursively change permissions on a directory</ span > < span style ="display: none ">
177
+ </ span > < span class ="attr "> $sftp-> chmod(0777, 'filename.remote');
178
+ //$sftp-> chmod(0777, 'dirname.remote', true); // recursively change permissions on a directory
179
+ // has the same syntax as < a href ="http://php.net/touch "> http://php.net/touch</ a >
180
+ $sftp-> touch('filename.remote');
181
+ $sftp-> chown('filename.remote', $uid);
182
+ //$sftp-> chown('filename.remote', $uid, true); // recursively change the owner
183
+ $sftp-> chgrp('filename.remote', $gid);
184
+ //$sftp-> chgrp('filename.remote', $gid, true); // recursively change the group
185
+ $sftp-> truncate('filename.remote', $size);</ span > < span style ="display: none ">
179
186
</ span > < span class ="stat "> echo $sftp-> size('filename.remote');
180
187
print_r($sftp-> stat('filename.remote'));
181
188
print_r($sftp-> lstat('filename.remote'));</ span > < span class ="delete "> $sftp-> delete('filename.remote'); // doesn't delete directories
0 commit comments