0

I am making my own file manager for linux, hopefully it will be cross platform, and I am trying to identify different file types, in particular folders.

I have already searched google but I could only find a way of identifying text files.
Does anyone have any advice on identifying file types?

4
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by slate
0

thanks, that helps a lot, I actually looked through the os module, I completely forgot about the os.path module

0
filerz = "c:\\cookie\\win\\etc\\beeeeeeepyyrasdf.doom"

def filetype(file):
    return file.split(".")[-1]

print filetype(filerz)

>> doom
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.