jeremyBanks / tmpdir

A Python module and command-line tool for working with temporary directories.
1 stars 0 forks source link

bencode-based archive format for testing #10

Open jeremyBanks opened 13 years ago

jeremyBanks commented 13 years ago

bencoding something like

    { b"": b"__tmpdir bencoding r0", # like this to create a magic header
      b"foo": [b"bar", 0644, 1308818163, 1308818180] }

might be useful as an private bijective encoding for testing.

jeremyBanks commented 13 years ago
    { b"": b"directory",
      b"foo": { b"": "file",
                b"data": b"bar\n",
                b"permissions": 0644 } }

bencoding is actually pretty suitable for this. Maybe name it private-bencoding.

jeremyBanks commented 13 years ago

Filenames are text, so I guess I'll define that they be stored in UTF-8, while their contents are the raw binary.

jeremyBanks commented 13 years ago

bencoding is actually pretty suitable for this. Maybe name it private-bencoding.

_bencoding may be more appropriate, by the Python convention.

jeremyBanks commented 13 years ago

I see that tars seem to be able to deal with special files. Looking at it, it seems possible to implement that, but it's pretty OS-specific...

If I want to be as portable as possible, maybe I should just add the options "read-only" and "executable" and be done with it.