Skip Menu |

This queue is for tickets about the Sys-Filesystem CPAN distribution.

Report information
The Basics
Id: 55058
Status: resolved
Priority: 0/
Queue: Sys-Filesystem

People
Owner: Nobody in particular
Requestors: reed [...] reedloden.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.27
Fixed in: (no value)



Subject: Special filesystems still being shown even if regular => undef
Test code: my $fs = Sys::Filesystem->new(); my @filesystems = $fs->filesystems(mounted => 1, regular => undef); for my $filesystem (@filesystems) { printf("%s is a %s filesystem mounted on %s\n", $fs->mount_point($filesystem), $fs->format($filesystem), $fs->device($filesystem) ); } Returns: / is a ext3 filesystem mounted on /dev/disk/by-uuid/xxxx-xxxx-xxxx /dev is a tmpfs filesystem mounted on udev /dev/pts is a devpts filesystem mounted on none /dev/shm is a tmpfs filesystem mounted on none /home/reed/.gvfs is a fuse.gvfs-fuse-daemon filesystem mounted on gvfs-fuse-daemon /lib/init/rw is a tmpfs filesystem mounted on none /media/sda1 is a fuseblk filesystem mounted on /dev/sda1 /media/sda2 is a fuseblk filesystem mounted on /dev/sda2 Why are filesystems such as "devpts", "tmpfs", etc. still being shown when I explicitly requested only regular filesystems? Sys::Filesystem 1.27 under perl v5.10.0 on Ubuntu 9.10.
This is a documentation bug, regular must be flagged as any other flag (mounted, special), too. Please try again using 'regular => 1'.
From: reed [...] reedloden.com
On Tue Mar 02 01:42:46 2010, REHSACK wrote: Show quoted text
> This is a documentation bug, regular must be flagged as any other flag > (mounted, special), too. Please try again using 'regular => 1'.
Test code: my $fs = Sys::Filesystem->new(); my @filesystems = $fs->filesystems(mounted => 1, regular => 1); for my $filesystem (@filesystems) { print $filesystem . " -- " . $fs->format($filesystem) . " (" . $fs->device($filesystem) . ")\n"; } Returns: / -- ext3 (/dev/disk/by-uuid/xxxx-xxxx-xxxx-xxxx) /dev -- tmpfs (udev) /dev/pts -- devpts (none) /dev/shm -- tmpfs (none) /home/reed/.gvfs -- fuse.gvfs-fuse-daemon (gvfs-fuse-daemon) /lib/init/rw -- tmpfs (none) /media/sda1 -- fuseblk (/dev/sda1) /media/sda2 -- fuseblk (/dev/sda2) /proc -- proc (none) /proc/fs/nfsd -- nfsd (nfsd) /proc/sys/fs/binfmt_misc -- binfmt_misc (binfmt_misc) /sys -- sysfs (none) /sys/fs/fuse/connections -- fusectl (none) /sys/kernel/debug -- debugfs (none) /sys/kernel/security -- securityfs (none) /var/lock -- tmpfs (none) /var/run -- tmpfs (none) Still seeing special filesystems...
Looks like I need to investigate more time to solve it :) Thanks for reporting - I'll try to address it as soon as possible.
I took a deeper look and I was right: it's documented right there at filesystems() introduction: Show quoted text
> The restrictions are evaluated to match as much as possible, > so asking for regular and special file system, you'll get all.
Read: it's an OR'ed evaluation, if either requested attributes apply, the filesystem is returned. I'll write it more clear in next version.
From: reed [...] reedloden.com
On Mon Apr 12 08:39:11 2010, REHSACK wrote: Show quoted text
> Read: it's an OR'ed evaluation, if either requested attributes apply, > the filesystem is returned.
Ugh, so how do you recommend just getting a list of mounted, non-special filesystems? I guess I'll just have to pass mounted => 1 (or nothing at all) and then just do a |last| in the loop to skip non-mounted and/or special filesystems.
Recommendation how to handle will be in the update (including the module which allows that, that's why it's worse to say it before). I'm sorry that I don't have better news, but I have the module taken from Nicola and my primary motivation wasn't to add more features like improved query interface, my primary motivation was to enhance support for several OS, quickly add new OS details (more quick than once a year ^^) etc. I'll try to finish the update until April 18th, but I need to try it out on a Solaris box and a Win32 box before - and I'm currently on-site at a customer.
Documentation updated and recommendation for DBD::Sys added (which provides access to several system tables using the Structured Query Language and is made for especially problems like yours)