Skip to content

fix(tar): tar -c cannot stat files on VFS #1118

@chaliy

Description

@chaliy

Summary

tar -c -z -f archive.tar.gz file.txt fails with Cannot stat: No such file or directory when operating on VFS files, even though the files exist and can be read by cat.

Reproduction

echo "content" > /tmp/test.txt
cat /tmp/test.txt   # works fine
tar -c -z -f /tmp/test.tar.gz -C /tmp test.txt
# Error: tar: test.txt: Cannot stat: No such file or directory
ls /tmp/test.tar.gz
# Error: cannot access: No such file or directory

Context

Discovered while running bashblog via bashkit CLI. Bashblog creates backups before rebuilding:

tar -c -z -f ".backup.tar.gz" -- *.html
chmod 600 ".backup.tar.gz"

This fails silently, so no backups are created during the rebuild process.

Expected behavior

tar -c should be able to stat and archive files that exist on the VFS. The -C directory change should also work with VFS paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions