mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-05-28 14:10:52 +00:00
SFTP: change where stat cache is being cleared for uploads
This commit is contained in:
parent
9637e25bf7
commit
31c5e50902
|
@ -1867,8 +1867,6 @@ class SFTP extends SSH2
|
|||
return false;
|
||||
}
|
||||
|
||||
$this->remove_from_stat_cache($remote_file);
|
||||
|
||||
$flags = NET_SFTP_OPEN_WRITE | NET_SFTP_OPEN_CREATE;
|
||||
// according to the SFTP specs, NET_SFTP_OPEN_APPEND should "force all writes to append data at the end of the file."
|
||||
// in practice, it doesn't seem to do that.
|
||||
|
@ -1885,6 +1883,8 @@ class SFTP extends SSH2
|
|||
$flags|= NET_SFTP_OPEN_TRUNCATE;
|
||||
}
|
||||
|
||||
$this->remove_from_stat_cache($remote_file);
|
||||
|
||||
$packet = Strings::packSSH2('sNN', $remote_file, $flags, 0);
|
||||
if (!$this->send_sftp_packet(NET_SFTP_OPEN, $packet)) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue
Block a user