| 1587 | } |
| 1588 | |
| 1589 | Status GcsFileSystem::GetFileSize(const string& fname, uint64* file_size) { |
| 1590 | if (!file_size) { |
| 1591 | return errors::Internal("'file_size' cannot be nullptr."); |
| 1592 | } |
| 1593 | |
| 1594 | // Only validate the name. |
| 1595 | string bucket, object; |
| 1596 | TF_RETURN_IF_ERROR(ParseGcsPath(fname, false, &bucket, &object)); |
| 1597 | |
| 1598 | FileStatistics stat; |
| 1599 | TF_RETURN_IF_ERROR(Stat(fname, &stat)); |
| 1600 | *file_size = stat.length; |
| 1601 | return Status::OK(); |
| 1602 | } |
| 1603 | |
| 1604 | Status GcsFileSystem::RenameFile(const string& src, const string& target) { |
| 1605 | if (!IsDirectory(src).ok()) { |