1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#!/usr/bin/env perl use 5.012; use warnings; use Cwd qw/getcwd/; use File::Temp qw/tempdir/; my $cwd = getcwd; for my $fs (@ARGV ? @ARGV : '.') { my $dir = tempdir(DIR => $fs, CLEANUP => 1); chdir $dir or die "Error in chdir() using $dir: $!"; my ($fold_create, $fold_open, $rename); if (open my $foo, '>Foo') { my %names = map { $_ => 1 } glob('*'); if ($names{foo}) { $fold_create = 'lc'; } elsif ($names{FOO}) { $fold_create = 'uc'; } else { $fold_create = 'none'; } } else { die "Error in open() using >Foo: $!"; } if (rename 'Foo', 'fOo') { $rename = 'allowed'; } else { $rename = 'disallowed'; } if (open my $foo, '<foO') { $fold_open = 'yes'; } else { $fold_open = 'none'; } chdir $cwd or warn "Error in chdir() using $cwd: $!"; say "$fs: fold_create=$fold_create, fold_open=$fold_open, rename=$rename"; }
1
2
3
4
5
6
7
Linux/ext3: fold_create=none, fold_open=none, rename=allowed
Linux/msdos: fold_create=lc, fold_open=yes, rename=allowed
Linux/vfat: fold_create=none, fold_open=yes, rename=allowed
Linux/hfs: fold_create=none, fold_open=yes, rename=allowed
WinXP/FAT: fold_create=none, fold_open=yes, rename=disallowed
WinXP/NTFS: fold_create=none, fold_open=yes, rename=disallowed
WinXP/Ext2Fsd: fold_create=none, fold_open=yes, rename=disallowed