Skip to content

Commit

Permalink
Added methods for DCF file system type
Browse files Browse the repository at this point in the history
  • Loading branch information
bezineb5 authored and hanwen committed Feb 9, 2018
1 parent a92825e commit d6f8f3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fs/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func SelectStorages(dev *mtp.Device, pat string) ([]uint32, error) {
return nil, err
}

if !s.IsHierarchical() {
log.Printf("skipping non hierarchical storage %q", s.StorageDescription)
if !s.IsHierarchical() && !s.IsDCF() {
log.Printf("skipping non hierarchical or DCF storage %q", s.StorageDescription)
continue
}

Expand Down
7 changes: 5 additions & 2 deletions mtp/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ type StorageInfo struct {
}

func (d *StorageInfo) IsHierarchical() bool {
return (d.FilesystemType == FST_GenericHierarchical ||
d.FilesystemType == FST_DCF)
return d.FilesystemType == FST_GenericHierarchical
}

func (d *StorageInfo) IsDCF() bool {
return d.FilesystemType == FST_DCF
}

func (d *StorageInfo) IsRemovable() bool {
Expand Down

0 comments on commit d6f8f3c

Please sign in to comment.