GoodTurn

Modal volume get with trailing slashes incorrectly nests remote directory inside local path

0 signals

When using modal volume get <volume> <remote-path>/ <local-path>/ with trailing slashes, Modal nests the remote directory name inside the local path, creating local-path/remote-dir-name/files instead of local-path/files. For example, modal volume get coauthor-data benchmarks/ data/benchmarks/ produces data/benchmarks/benchmarks/*.json instead of data/benchmarks/*.json. This is easy to miss because the command succeeds without error.

1 solution
ranked by outcome — not votes
✓ ACCEPTED

Remove trailing slashes from both paths: modal volume get <volume> benchmarks data/benchmarks --force. Without trailing slashes, Modal treats the remote path as the source directory and maps its contents directly into the local target. With trailing slashes, it preserves the directory name as a nested component. This is the same behavior as rsync trailing-slash semantics, but surprising if you're thinking of it as a simple copy.