>>> Something like the "file" utility for linux would be very helpfull. >>> >>> Any help is appreciated. > >>You're going to have to describe in detail what's in the file before >>anybody can help. > > We are creating inside our buildsystem for an embedded system a cram > filesystem > image. Later on inside our build process we have to check the endianness, > because it could be Little Endian or big endian (arm or ppc). > > The output of the "file" tool is for a little endian cramfs image: > <ourImage>: Linux Compressed ROM File System data, little endian size > 1875968 > version #2 sorted_dirs CRC 0x8721dfc0, edition 0, 462 blocks, 10 files > > It would be possible to execute > ret = os.system("file <ourImage> | grep "little endian") > and evaluate the return code. > But I don't like to evaluate a piped system command. If there is an way > without > using the os.system command this would be great. >
Please see http://pypi.python.org/pypi/python-magic HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list