On Friday 31 August 2007 15:25:17 Bo Peng wrote: > > 1/ if it is not done already, support for reading/writing compressed > > lyx files should be removed: it has no interested wrt .zip file > > version. > > I agree. It does not make sense to keep two compressed version. I am > not sure if lyx2lyx decompress compressed lyx file though.
No it does not. If the file is not compressed lyx will not compress and vice-versa. Would you or Jean-Marc would like such an option: --force-compress --force-decompress > > 2/ is the new zip base version designed such that a "file" utility can > > guess its type based on the first few characters of the binary file? > > It could be doable if the first file (the manifest?) is stored instead > > of deflated. > > Yes. It is a regular zip file. It is not easy to get .lyx or manifest > version without unzipping it first though. zcat is your friend. unzip -l is the answer to the second question. > > 3/ another option would be to make sure that the .lyx file is first, > > so that utilities like zcat can read them transparently like gzipped > > files (not sure about the utility of that though). > > This is a good idea but I am not sure if python/zipfile can read the > first few bytes of the first file easily. That is precisely what it does. It is the same as the gzip module. It reads the start of the file and checks the magical signature. So what I intend to do is to ask "Is this a zip file?" else "Is this a gzipped file" else it is a text file. In logical terms it is quite easy to follow. > Bo -- José Abílio