FAQ
Hi,

Under Linux I'd like to find out, whether I got a file, a character
device or a socket as a parameter.


What is the right way to do this


How can I found out, whether a path name is:
- a file ( os.isfile() )
- a character device
- a socket
- a named pipe



thanks a lot for pointers

Search Discussions

  • Steven D'Aprano at Aug 30, 2010 at 12:09 am

    On Mon, 30 Aug 2010 01:46:16 +0200, News123 wrote:

    Hi,

    Under Linux I'd like to find out, whether I got a file, a character
    device or a socket as a parameter.
    See the stat module.



    --
    Steven
  • News123 at Aug 30, 2010 at 8:44 am

    On 08/30/2010 02:09 AM, Steven D'Aprano wrote:
    On Mon, 30 Aug 2010 01:46:16 +0200, News123 wrote:

    Hi,

    Under Linux I'd like to find out, whether I got a file, a character
    device or a socket as a parameter.
    See the stat module.
    Thks a lot.

    I was looking in os.path and forgot about stat (it obviously was too
    late :-( )

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedAug 29, '10 at 11:46p
activeAug 30, '10 at 8:44a
posts3
users2
websitepython.org

2 users in discussion

News123: 2 posts Steven D'Aprano: 1 post

People

Translate

site design / logo © 2021 Grokbase