Comments (7)
Ok, I looked closer to code and se, that trimming is performed afterwords with javascript, so, line could be just:
'df | grep ' + drive + ' | grep -oh \' /.*\''
from nodejs-disks.
Yeah. I've run into this as well. (Check out my fork.)
I switched it with this:
'df -kl | grep ' + drive + ' | awk '{ for (i = 9; i <= NF; i++) print $i}' ORS=' ''
Not the best because it assumes that the 9th is the beginning of the mount point. What if the first parameter has a space in it?
What does yours do?
from nodejs-disks.
Mine just finds row with drive and asumes that / will be last param with "/" (slash), which will be the mount point. So - it returns everything from this /. Extra space will be trimmed by javascript.
from nodejs-disks.
Does that get "/Volumes/some drive"?
from nodejs-disks.
In my case it did :D
from nodejs-disks.
A case where that would fail is if the mount point folder has a trailing space ('/Volumes /some drive'). I think that's less possible than the first field having a space in it. So, it's a better solution than mine. Do you know if it's possible?
from nodejs-disks.
Never saw such mountpoint naming, but users are geniuses and, if someone allows to do this, they will :D
I just tested on my mac (el capitan) and my solution worked on flahsdrive called " My flash " (space before "My" and after "flash"). So - need to be tested on other platforms :)
from nodejs-disks.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodejs-disks.