I am trying to convert a file type/permissions to a number, for example:
-rw-r--r-- 1 user user 741 Mar 10 15:40 test.js
I know how to convert the permissions "rw-r--r--" to a number, but I am stuck as to how to convert the file type "-" also?
I am trying to set the st_mode in the FUSE getattr method and I need this number from the string. I'm not sure how to combine the type and the permissions together into 1 number so I can set the mode in FUSE. Thanks, also I am using fuse4js.