7 kyu
Unix command line `ls -l` extract the file type.
389 of 816nbeck
Description:
On Unix system type files can be identified with the ls -l command which displays the type of the file in the first alphabetic letter of the file system permissions field. You can find more information about file type on Unix system on the wikipedia page.
- '-' A regular file ==>
file
. - 'd' A directory ==>
directory
. - 'l' A symbolic link ==>
symlink
. - 'c' A character special file. It refers to a device that handles data as a stream of bytes (e.g: a terminal/modem) ==>
character_file
. - 'b' A block special file. It refers to a device that handles data in blocks (e.g: such as a hard drive or CD-ROM drive) ==>
block_file
. - 'p' a named pipe ==>
pipe
. - 's' a socket ==>
socket
. - 'D' a door ==>
door
.
In this kata you should complete a function that return the filetype
as a string regarding the file_attribute
given by the ls -l
command.
For example if the function receive -rwxr-xr-x
it should return file
.
Strings
Regular Expressions
Fundamentals
Similar Kata:
Stats:
Created | Nov 9, 2016 |
Published | Nov 10, 2016 |
Warriors Trained | 1150 |
Total Skips | 6 |
Total Code Submissions | 1594 |
Total Times Completed | 816 |
Ruby Completions | 82 |
Crystal Completions | 13 |
JavaScript Completions | 318 |
CoffeeScript Completions | 13 |
Python Completions | 389 |
Haskell Completions | 70 |
Total Stars | 12 |
% of votes with a positive feedback rating | 82% of 210 |
Total "Very Satisfied" Votes | 148 |
Total "Somewhat Satisfied" Votes | 47 |
Total "Not Satisfied" Votes | 15 |
Total Rank Assessments | 8 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |