question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gsutil work with explicit directories

See original GitHub issue

gcsfuse requires explicit directories by default. So the bucket has object:

dir/
dir/a.txt

When do gsutils cp, mv, rsync and I need to copy/move the explicit directory too. Reason: gsutil is faster then gcsfuse and the gcsfuse cannot mv (rename) directories. So when I do gsutil mv gs://bucket/dir gs://bucket/newdir, I got the objects:

dir/
newdir/a.txt

but I would expect

newdir/
newdir/a.txt

Similarly with gsutils cp, rsync - the newdir/ explicit directory is not created.

Note: as a workaround I have created a shell script to create explicit dirs gsmkdirs.sh.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:6
  • Comments:20 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
rjain15commented, Jan 17, 2018

+1 on something built into gsutil. I can do it from the web console, wonder why doesn’t the cli support?

4reactions
thobrlacommented, Oct 12, 2016

It’s unlikely we’ll add support for gsutil to create placeholder objects representing directories. gsutil tries to be compatible with these placeholder objects, but it does not create them because it complicates gsutil command semantics.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Folders | Cloud Storage - Google Cloud
The Google Cloud console creates a visual representation of folders that resembles a local file browser. gsutil simulates the typical command-line directory ......
Read more >
Exclude a certain file or directory while copying from a Google ...
I want to copy all the files and directories except dir3 from the bucket to my local directory. Usually I would do gsutil...
Read more >
How can I upload folders to Google Cloud? - Super User
Similarly, neglecting to specify this option for a download will cause gsutil to copy any objects at the current bucket directory level, and ......
Read more >
Folder Upload & Download in GCS - Infiflex
The following procedure is about file upload and download in Google Cloud Storage using Cloud SDK. · 1. Download · 2. Install SDK...
Read more >
Refreshing Directory Tables Automatically for Google Cloud ...
Google Cloud Storage Stage Integration Flow ... The following example creates an integration that explicitly limits external stages that use the integration ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found