getfsent(3) and spaces in fstab
Simon Barner
barner at in.tum.de
Wed Jul 30 17:08:45 PDT 2003
> Just a thort, not having tried it ..
>
> does either of the 'standard' methods of including spaces actually work
> in fstab ??
>
> I speak of quoting (either single or double) and backslashing the space
>
> "/mnt/space/silly long dirname/filename also with spaces"
>
> or
>
> /mnt/space/silly\ long\ dirname/filename\ also\ with\ spaces
Sorry, I should have written that I have performed tests:
Here is what I did:
test\ 1 /mnt/test\ 1 ufs ro 0 0
'test 2' '/mnt/test 2' ufs ro 0 0
"test 3" "/mnt/test 3" ufs ro 0 0
This test program
---> snip <--
#include <fstab.h>
int main (int argc, char *argv[]) {
struct fstab *f;
while (0 != (f = getfsent ())) {
printf ("%s %s %s\n", f->fs_spec, f->fs_file, f->fs_vfstype);
}
return 0;
}
---> snip <--
Gives me the following output:
/dev/ad0s2b none swap
/dev/ad0s1a / ufs
/dev/ad0s2g /usr ufs
/dev/ad0s2f /home ufs
/dev/ad0s2e /var ufs
/dev/vinum/mucke /samba-export ufs
/dev/acd0c /mnt/cdrom cd9660
/dev/fd0.1440 /mnt/floppy msdos
proc /proc procfs
kern /kern kernfs
linproc /compat/linux/proc linprocfs
fstab: /etc/fstab:14: Inappropriate file type or format
fstab: /etc/fstab:15: Inappropriate file type or format
fstab: /etc/fstab:16: Inappropriate file type or format
Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: Digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20030731/6734d5b9/attachment.bin
More information about the freebsd-hackers
mailing list