You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specify & consolidate an API that file system drivers would implement to make them interoperate with node-disk, so that file systems could be automatically detected & mounted.
Prototype API Example:
varBlockDevice=require('blockdevice')varDisk=require('disk')varNTFS=require('ntfs')varHFS=require('hfsp')varExFAT=require('exfat')// Create the block devicevardevice=newBlockDevice({path: BlockDevice.getPath(0),})// Create the diskvardisk=newDisk(device)// Add file systems to use for auto-mounting, middleware-styledisk.use(NTFS)disk.use(HFS)// Auto-mount known file systems// Note: would also need to introduce options in `disk.open()`disk.open({mount: true},function(error){// Note: Iteration should be async, but kept simple here for the sake of demonstration disk.partitions.forEach(function(partition){if(partition.volume){// partition.volume = partition.fs.create( partition, options )partition.volume.fs.readdir(function(error,ls){// ...})}})})// Don't auto-mount; but create a volume for the partitiondisk.open({mount: false},function(error){disk.partitions.forEach(function(partition){if(partition.volume){// Manually mount the volumepartition.volume.mount(function(error,fs){// ...})}})})// Or manually mount a file system on a given partitiondisk.mount(disk.partitions[1],ExFAT,function(error,volume){// partition.volume === volumevolume.fs.readdir('/',function(error,ls){// ...})})
The text was updated successfully, but these errors were encountered:
Specify & consolidate an API that file system drivers would implement to make them interoperate with node-disk, so that file systems could be automatically detected & mounted.
Prototype API Example:
The text was updated successfully, but these errors were encountered: