gsutil_util: replace `du` with `stat`

`gsutil du PATH` no longer returns an error even if the file does not
exist. Use `gsutil stat` instead.

TEST=Manually run the commands using different gsutil versions

Change-Id: I7af64735a2b6dae67fb2b724792c1734da3f3511
Tested-by: Yu-Ju Hong <>
Reviewed-by: Chris Sosa <>
Commit-Queue: Yu-Ju Hong <>
diff --git a/ b/
index 709bc64..bf69c10 100644
--- a/
+++ b/
@@ -126,9 +126,8 @@
   # If the pattern is a glob and contains no wildcards, we'll first attempt to
   # stat the file via du.
   if not (is_regex_pattern or _GlobHasWildcards(pattern)):
-    get_methods.append(('gsutil du %s/%s' % (archive_url, pattern),
-                        'Failed to du on the artifact file.',
-                        pattern))
+    get_methods.append(('gsutil stat %s/%s' % (archive_url, pattern),
+                        'Failed to stat on the artifact file.', pattern))
   # The default method is to check the manifest file in the archive directory.
   get_methods.append(('gsutil cat %s/%s' % (archive_url, UPLOADED_LIST),
diff --git a/ b/
index 6ac85cd..3071825 100755
--- a/
+++ b/
@@ -109,7 +109,7 @@
     self.mox.StubOutWithMock(gsutil_util, 'GSUtilRun')
     # GSUtil cat gs://archive_url_prefix/UPLOADED.
-    gsutil_util.GSUtilRun(mox.StrContains('gsutil du %s/%s' %
+    gsutil_util.GSUtilRun(mox.StrContains('gsutil stat %s/%s' %
                                           (archive_url, pattern)),
                               '%s\n%s' % (mock_data, name))