> ... While a "-d" switch would be great to have, it'd also be great if we could make the protofile format work with escaped spaces. That way we can just add escaping for spaces in our tooling that calls mkfs.xfs and we don't have to do ugly version checks on the mkfs binary version to figure out which option to use. On Wed, 25 Jan 2023 at 02:53, Darrick J. Wong <djwong@xxxxxxxxxx> wrote: > > On Mon, Jan 23, 2023 at 10:13:12PM +0100, Daan De Meyer wrote: > > Hi, > > > > We're trying to use mkfs.xfs's "-p" protofile option for unprivileged > > population of XFS filesystems. However, the man page does not specify > > how to encode filenames with spaces in them. Spaces are used as the > > token delimiter so I was wondering if there's some way to escape > > filenames with spaces in them? > > Spaces in filenames apparently weren't common when protofiles were > introduced in the Fourth Edition Unix in November 1973[1], so that > wasn't part of the specification for them: > > "The prototype file contains tokens separated by spaces or new > lines." > > The file format seems to have spread to other filesystems (minix, xenix, > afs, jfs, aix, etc.) without anybody adding support for spaces in > filenames. > > One could make the argument that the protofile parsing code should > implicitly 's/\// /g' in the filename token since no Unix supports > slashes in directory entries, but that's not what people have been > doing for the past several decades. > > At this point, 50 years later, it probably would make more sense to > clone the mke2fs -d functionality ("slurp up this directory tree") if > there's interest? Admittedly, at this point it's so old that we ought > to rev the entire format. > > [1] https://dspinellis.github.io/unix-v4man/v4man.pdf (page 274) > or https://man.cat-v.org/unix-6th/8/mkfs > > --D > > > Cheers, > > > > Daan De Meyer