Skip to content

Commit

Permalink
core/commands/unixfs: Rename 'ipfs unixfs' to 'ipfs file'
Browse files Browse the repository at this point in the history
To be less confusing to newcomers (the IPFS filesystem isn't
Unix-specific anyway, and it isn't even very POSIX-specific [1,2,3]).
I'm a bit uncertain about having one name for users and another for
devs, but the consensus seems to be that mainaining two names is worth
the trouble [4].  We also kicked around:

* 'files' (plural),
* 'filesystem' (too long), and
* 'fs' (redundant after 'ipfs', even though IPFS isn't just about
  filesystems)

on IRC [5 through 6].  I wish there was a more evocative term.  I'm
never sure where "file" lands on the scale between "filesysytem",
"everything is a file", "a single chunk of data with an associated
inode".  But we can't think of anything better.

[1]: #1348 (comment)
[2]: #1348 (comment)
[3]: https://github.com/ipfs/go-ipfs/pull/1136/files#r29377283
  In my response to this (no longer visibile on GitHub):

  On Wed, Apr 29, 2015 at 01:30:04PM -0700, Juan Batiz-Benet wrote:
  > > +package fsnode
  >
  > i think this package should be called `unixfs` as that's the
  > abstraction that this is calling to.

  Will do, although I don't see what's especially Unix-y about these
  file nodes.

[4]: #1348 (comment)
[5]: https://botbot.me/freenode/ipfs/2015-06-09/?msg=41428456&page=5
[6]: https://botbot.me/freenode/ipfs/2015-06-09/?msg=41430703&page=5
  • Loading branch information
wking committed Jun 9, 2015
1 parent bdefbbb commit 7c91e3a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions core/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ DATA STRUCTURE COMMANDS
block Interact with raw blocks in the datastore
object Interact with raw dag nodes
unixfs Interact with Unix filesystem objects
file Interact with Unix filesystem objects
ADVANCED COMMANDS
Expand Down Expand Up @@ -104,7 +104,7 @@ var rootSubcommands = map[string]*cmds.Command{
"stats": StatsCmd,
"swarm": SwarmCmd,
"tour": tourCmd,
"unixfs": unixfs.UnixFSCmd,
"file": unixfs.UnixFSCmd,
"update": UpdateCmd,
"version": VersionCmd,
"bitswap": BitswapCmd,
Expand Down
4 changes: 2 additions & 2 deletions core/commands/unixfs/unixfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ var UnixFSCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Interact with ipfs objects representing Unix filesystems",
ShortDescription: `
'ipfs unixfs' provides a familar interface to filesystems represtented
'ipfs file' provides a familar interface to filesystems represtented
by IPFS objects that hides IPFS-implementation details like layout
objects (e.g. fanout and chunking).
`,
Synopsis: `
ipfs unixfs ls <path>... - List directory contents for <path>...
ipfs file ls <path>... - List directory contents for <path>...
`,
},

Expand Down
20 changes: 10 additions & 10 deletions test/sharness/t0200-unixfs-ls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# MIT Licensed; see the LICENSE file in this repository.
#

test_description="Test unixfs ls command"
test_description="Test file ls command"

. lib/test-lib.sh

Expand Down Expand Up @@ -38,11 +38,11 @@ test_ls_cmd() {
test_cmp expected_add actual_add
'

test_expect_success "'ipfs unixfs ls <three dir hashes>' succeeds" '
ipfs unixfs ls QmfNy183bXiRVyrhyWtq3TwHn79yHEkiAGFr18P7YNzESj QmR3jhV4XpxxPjPT3Y8vNnWvWNvakdcT3H6vqpRBsX1MLy QmSix55yz8CzWXf5ZVM9vgEvijnEeeXiTSarVtsqiiCJss >actual_ls
test_expect_success "'ipfs file ls <three dir hashes>' succeeds" '
ipfs file ls QmfNy183bXiRVyrhyWtq3TwHn79yHEkiAGFr18P7YNzESj QmR3jhV4XpxxPjPT3Y8vNnWvWNvakdcT3H6vqpRBsX1MLy QmSix55yz8CzWXf5ZVM9vgEvijnEeeXiTSarVtsqiiCJss >actual_ls
'

test_expect_success "'ipfs unixfs ls <three dir hashes>' output looks good" '
test_expect_success "'ipfs file ls <three dir hashes>' output looks good" '
cat <<-\EOF >expected_ls &&
QmfNy183bXiRVyrhyWtq3TwHn79yHEkiAGFr18P7YNzESj:
QmSix55yz8CzWXf5ZVM9vgEvijnEeeXiTSarVtsqiiCJss Directory 246 d1
Expand All @@ -61,11 +61,11 @@ test_ls_cmd() {
test_cmp expected_ls actual_ls
'

test_expect_success "'ipfs unixfs ls --headers <three dir hashes>' succeeds" '
ipfs unixfs ls --headers QmfNy183bXiRVyrhyWtq3TwHn79yHEkiAGFr18P7YNzESj QmR3jhV4XpxxPjPT3Y8vNnWvWNvakdcT3H6vqpRBsX1MLy QmSix55yz8CzWXf5ZVM9vgEvijnEeeXiTSarVtsqiiCJss >actual_ls_headers
test_expect_success "'ipfs file ls --headers <three dir hashes>' succeeds" '
ipfs file ls --headers QmfNy183bXiRVyrhyWtq3TwHn79yHEkiAGFr18P7YNzESj QmR3jhV4XpxxPjPT3Y8vNnWvWNvakdcT3H6vqpRBsX1MLy QmSix55yz8CzWXf5ZVM9vgEvijnEeeXiTSarVtsqiiCJss >actual_ls_headers
'

test_expect_success "'ipfs unixfs ls --headers <three dir hashes>' output looks good" '
test_expect_success "'ipfs file ls --headers <three dir hashes>' output looks good" '
cat <<-\EOF >expected_ls_headers &&
QmfNy183bXiRVyrhyWtq3TwHn79yHEkiAGFr18P7YNzESj:
Hash Type Size Name
Expand All @@ -87,11 +87,11 @@ test_ls_cmd() {
test_cmp expected_ls_headers actual_ls_headers
'

test_expect_success "'ipfs unixfs ls <file hashes>' succeeds" '
ipfs unixfs ls /ipfs/QmR3jhV4XpxxPjPT3Y8vNnWvWNvakdcT3H6vqpRBsX1MLy/1024 QmQNd6ubRXaNG6Prov8o6vk3bn6eWsj9FxLGrAVDUAGkGe >actual_ls_file
test_expect_success "'ipfs file ls <file hashes>' succeeds" '
ipfs file ls /ipfs/QmR3jhV4XpxxPjPT3Y8vNnWvWNvakdcT3H6vqpRBsX1MLy/1024 QmQNd6ubRXaNG6Prov8o6vk3bn6eWsj9FxLGrAVDUAGkGe >actual_ls_file
'

test_expect_success "'ipfs unixfs ls <file hashes>' output looks good" '
test_expect_success "'ipfs file ls <file hashes>' output looks good" '
cat <<-\EOF >expected_ls_file &&
QmbQBUSRL9raZtNXfpTDeaxQapibJEG6qEY8WqAN22aUzd File 1024 /ipfs/QmR3jhV4XpxxPjPT3Y8vNnWvWNvakdcT3H6vqpRBsX1MLy/1024
QmQNd6ubRXaNG6Prov8o6vk3bn6eWsj9FxLGrAVDUAGkGe File 128 QmQNd6ubRXaNG6Prov8o6vk3bn6eWsj9FxLGrAVDUAGkGe
Expand Down

0 comments on commit 7c91e3a

Please sign in to comment.