7
Python 2.7'de yolun soket olup olmadığını öğrenmek için en iyi yol ne olurdu?Yolun Python 2.7'de bir soket olup olmadığını kontrol etme
os.path... directories, normal files ve links için işlevleri olduğunu etmiştir. stat modül Ben
import os, stat
path = "/path/to/socket"
mode = os.stat(path).st_mode
isSocket = stat.S_ISSOCK(mode)
print "%s is socket: %s" % (path, isSocket)
bu tercih edilen yöntem midir
olarak kullanılan S_ISSOCK(mode) gibi bazı S_IS ... fonksiyonları sunuyor?
Başka yol göremiyorum. Makul görünüyor. –