由买买提看人间百态

topics

全部话题 - 话题: gzip
1 2 3 4 下页 末页 (共4页)
g*********s
发帖数: 1782
1
来自主题: Programming版 - 一个popen加gzip的问题
FILE *fp = popen(gzip_file(fileName), "w");
...
gzip_file是这样定义的:
const char* gzip_file(const char* file_name)
{
static sda::string cmd;
cmd = _gzip_path + sda::string(" > ") + sda::string(file_name);
return cmd.c_str();
}
现在传进的参数文件名比较怪异,带空格的,比如"abc def.gz"。这样gzip command变
成了:gzip >abc def.gz。然后gzip报错:gzip: def.gz: No such file or
directory。但是abc文件还是生成了,而且文件指针也返回了。问题在于abc这个文件
根本无法写入,所以后面又出现了fwrite error。
有什么办法第一时间抓住这个gzip错误呢?不许用parser提前分析文件名。
I**A
发帖数: 96
2
来自主题: Unix版 - How to gzip a directory directly ?
I have a huge directory.
I want to archive it.
I used tar:
tar -cvf Myproject.tar Myproject
then used gzip:
gzip Myproject.tar
to generate .gz file.
But, the intermediate myproject.tar is too big, like 400GB.
I want to know how I can compress the directory directly.
Because the file is very huge, I doubt if tar pipe gzip works.
I saw there is tar -z can compress directly when we tar it. But my ksh does
not have this -z option.
T*****B
发帖数: 160
3
I want to output the the results in text format, which is in the range of 3GB.

Is there a way to open a writable File handle in gzip format, and write in
gzip format directly?
Many Thanks!
T********r
发帖数: 6210
4
来自主题: Unix版 - how to use gzip at Solaris2.6?\
download the gzip package from www.sunfreeware.com, and install it as
root: pkgadd -d gzip-package-name
c*****n
发帖数: 75
5
用wireshark看首页的packets,
text/plain, text/html的content-encoding都是gzip.
有的文件很小。
为啥?
d****n
发帖数: 1637
6
【 以下文字转载自 Programming 讨论区 】
发信人: dryden (拽的狠-仁义礼智信), 信区: Programming
标 题: Don Knuth releases Volume 4, Pre-fascicle 6A [gzipped ps]
发信站: BBS 未名空间站 (Thu Aug 2 10:47:20 2012, 美东)
http://www-cs-faculty.stanford.edu/~knuth/fasc6a.ps.gz
看不懂啊看不懂
老头身体不太好了,着急先把草稿发出来了。
"""
Chapter 7 will eventually fill at least four volumes(namely Volumes 4A, 4B,
4C and 4D), assuming that I'm able to remain healthy.
"""
t*g
发帖数: 1758
7
来自主题: Java版 - 请教一个读gzip文件的问题
我的gzip文件里第一行末有一个\r\n,我的BufferReader 就不读入任何\r\n之后的内容
。我能怎么读入后面的内容呢?谢谢!
BufferedReader br = new BufferedReader(new InputStreamReader(new
GZIPInputStream(fis, 1)));
t*g
发帖数: 1758
8
来自主题: Java版 - 请教一个读gzip文件的问题
发现不是\r\n的问题。我重新gzip一下,就没问题了。是怎么回事?
b******y
发帖数: 9224
9
来自主题: Java版 - 请教一个读gzip文件的问题
not sure about your question, here is a sample code for gzip:
http://www.jiansnet.com/topic?id=20649
c**e
发帖数: 2
10
【 以下文字转载自 Software 讨论区 】
【 原文由 core 所发表 】
I try to gzip the realplayer file before I ftp, but
the file size is almost unchanged. I tried compress afterwards,
but the effect is even more ridiculous, the file size is larger.
Who has any better idea of file compress? I can't use Winzip since
I'm using Solaries.
f*******e
发帖数: 4
11
来自主题: Unix版 - how to use gzip at Solaris2.6?\
在Solaris2.6下不能使用gzip,请问有什么方法可以打开*.tar.gz?
p******f
发帖数: 162
12
来自主题: Unix版 - how to use gzip at Solaris2.6?\
install gzip
z*******m
发帖数: 87
13
来自主题: Statistics版 - 如何用SAS直接读gzip压缩文件?
请教大牛,在windows系统中如何用SAS读取gzip文件?文件非常大,解压后我的电脑空
间都不够了。所以想在SAS里面直接读取。
顺便请教,以下语句是不是只适用于unix系统?
filename name pipe 'gunzip -c /directory/file.gz';
z*******m
发帖数: 87
14
来自主题: Statistics版 - 如何用SAS直接读gzip压缩文件?
我有几百个gzip文件,全部解压后电脑空间不够。用SAS直接读的话,一次只解压一个
,空间就够了呀。
z*******m
发帖数: 87
15
来自主题: Statistics版 - 如何用SAS直接读gzip压缩文件?
谢谢!
终于知道怎么在windows中用SAS读.gz了!
filename census pipe '"C:\Program Files\GnuWin32\bin\gzip.exe" -cd E:\
MyName\PROJECT\mydata.txt.gz' ;
我以前的问题是: 数据所在的文件夹‘My name’中有个空格。把文件夹命改成‘
Myname’后就运行成功了!
看来以后给文件夹命名,最好不要加空格或其他特殊符号。
l********k
发帖数: 14844
16
自己顶一个:afio
docstore.mik.ua/orelly/unix3/upt/ch38_05.htm
There are good arguments both for and against compression of tar archives
when making backups. The overall problem is that neither tar nor gzip is
particularly fault-tolerant, no matter how convenient they are. Although
compression using gzip can greatly reduce the amount of backup media
required to store an archive, compressing entire tar files as they are
written to floppy or tape makes the backup prone to complete loss if one
block of th... 阅读全帖
h******b
发帖数: 6055
17
来自主题: Programming版 - 十个包子求助:NodeJS多线程?
var directory = require('fs');
function processFile(filename) {
// dependencies
var fs = require('fs');
var zlib = require('zlib');
var csv = require('csv');
// filenames
var sourceFileName = filename;
mainFileName = 'main_' + filename;
// streams
var reader = fs.createReadStream(__dirname + '/original/' + sourceFileName),
writer = fs.createWriteStream(__dirname + '/transformed/' + mainFileName),
gunzip = zlib.createGunzip(),
gzip = zlib.createGzip();
//Main File
csv()
.from.stream(reader.pipe(g... 阅读全帖
q*p
发帖数: 963
18
来自主题: Hardware版 - 7zip到底靠谱不靠谱啊?
源于lzma,但青出于蓝而胜于蓝。
7z是LZMA,xz是LZMA2。
xz现在大行其道。
XZ Utils
XZ Utils is free general-purpose data compression software with high
compression ratio. XZ Utils were written for POSIX-like systems, but also
work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
The core of the XZ Utils compression code is based on LZMA SDK, but it has
been modified quite a lot to be suitable for XZ Utils. The primary
compression algorithm is currently LZMA2, which is used inside the .xz
container fo... 阅读全帖
w***g
发帖数: 5958
19
来自主题: Linux版 - 问题:关于python和web
web和语言没有直接的关系。最简单的动态网页可以直接用bash写,比如下面这个, 用来
把文件ABCDE压缩后发送给用户。
#!/bin/bash
echo "Content-type: applicatioin/gzip"
echo "Content-Disposition: attachment; filename=xxx.gzip"
echo
gzip -c ABCDE
python和perl之所以经常用来开发web是因为这两个语言开发比较快,而且体系结构无关


develop
a****n
发帖数: 1528
20
【 以下文字转载自 Unix 讨论区 】
发信人: arklin (arklin), 信区: Unix
标 题: solaris的ssh为什么后台执行的时候进程不退出?
发信站: BBS 未名空间站 (Mon Sep 27 22:11:21 2010, 美东)
我用的是sun的ssh,登录到远程的另一个solaris上
SSH是在一个脚本程序a.sh里执行,然后把这个脚本放在crontab里(是不是就相当于用
&来后台执行?)
命令很简单类似这样:
ssh a**[email protected] 'gzip a.b'
如果是我手动在shell下执行这个脚本,gzip完毕后就会退出,没有任何问题
但是如果在crontab里,或者用a.sh &来后台执行,该进程就会一直hang在内存里,必须
用kill才能杀掉(而远程的gzip任务已经执行完毕)
请问谁对这个有经验?
F****3
发帖数: 1504
21
来自主题: Linux版 - 怎样保证隐私?
请问怎么看真实进程?我在用gzip来zip我的一个目录架的时候,其他用户能够看到
gzip正在处理那个文件吗?比如
gzip abc_folder
里面有
file1
file2
file3
别人能看到file1,file2, file3的文件名吗?
谢谢!
a****n
发帖数: 1528
22
我用的是sun的ssh,登录到远程的另一个solaris上
SSH是在一个脚本程序a.sh里执行,然后把这个脚本放在crontab里(是不是就相当于用
&来后台执行?)
命令很简单类似这样:
ssh a**[email protected] 'gzip a.b'
如果是我手动在shell下执行这个脚本,gzip完毕后就会退出,没有任何问题
但是如果在crontab里,或者用a.sh &来后台执行,该进程就会一直hang在内存里,必须
用kill才能杀掉(而远程的gzip任务已经执行完毕)
请问谁对这个有经验?
a****n
发帖数: 1528
23
我用的是sun的ssh,登录到远程的另一个solaris上
SSH是在一个脚本程序a.sh里执行,然后把这个脚本放在crontab里(是不是就相当于用
&来后台执行?)
命令很简单类似这样:
ssh [email protected]
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
'gzip a.b'
如果是我手动在shell下执行这个脚... 阅读全帖
l******g
发帖数: 188
24
get the total number of unique lines across a data set of 1000 gzipped text
files.
for instance: If every file has two lines, "this is line1" and "this a
line2", then the total count of lines is 2000, and total number of unique
lines is 2.
1 1000 machines where each machine has one gzipped text file with an
approximate size of 50GB. The file on each machine is /0/data/foo.txt.gz
2 1000 machines are named data1, data2,..data1000.
3 Data format ASCII text.
4 we have 11 machines named res1, res2…r... 阅读全帖
l******g
发帖数: 188
25
get the total number of unique lines across a data set of 1000 gzipped text
files.
for instance: If every file has two lines, "this is line1" and "this a
line2", then the total count of lines is 2000, and total number of unique
lines is 2.
1. 1000 machines where each machine has one gzipped text file with an
approximate size of 50GB. The file on each machine is /0/data/foo.txt.gz
2. 1000 machines are named data1, data2,..data1000.
3. Data format ASCII text.
4. we have 11 machines named res1, re... 阅读全帖
a**********0
发帖数: 422
26
来自主题: JobHunting版 - 发个我总结的unix常用命令
The Unix Commands
其实就是攒了一下网上的资料
# Create a new tar archive.
# the folder dirname/ is compressed into archive_name.tar
tar cvf archive_name.tar dirname/
# Extract from an existing tar archive
tar xvf archive_name.tar
# View an existing tar archive
tar tvf archive_name.tar
# Search for a given string in a file (case in-sensitive search).
grep -i "the" demo_file
# Print the matched line, along with the 3 lines after it.
grep -A 3 -i "example" demo_text
# Search for a given string in all files recur... 阅读全帖
e****e
发帖数: 3450
27
来自主题: SanFrancisco版 - 找熟悉用mac 编程的帮忙
我按这个readme来的
Software Requirements
=====================
1. GCC is required to compile most tools.
2. FASTA-Clipping-Histogram tool requires Perl, the "PerlIO::gzip",
"GD::Graph::bars" modules.

Installing the perl modules can be accomplised by running:
$ sudo cpan 'PerlIO::gzip'
$ sudo cpan 'GD::Graph::bars'

3. FASTX-Barcode-Splitter requires the GNU Sed program.

4. FASTQ-Quality-Boxplot and FASTQ-Nucleotides-Distribution requires the
'gnuplot' program.
Installation
=====
j***n
发帖数: 301
28
来自主题: BuildingWeb版 - about http compression
Hi all,
I'm trying to take advantage of http compression / decompression feature men
tioned in RFC2616.
I have created two gziped files using unix gzip command: file1 and file2.
I deployed them to tomcat and wrote a simple program to set the appropriate
http header. In FF or IE the file can be browsed as regular page without run
time compression overhead at serverside.
When I concatenated file1 and file2 into one file, I was still able to decom
press them using Unix gzip command. What I got is a
h******e
发帖数: 730
29
似乎这个帖子给出了答案。。
http://forum.doozan.com/read.php?2,11396
其中 okigan Wrote:
uBoot file needs to be created from vmlinuz, which is not happening for what
ever reason.
The following seems to correct the problem:
cd /tmp/debian/usr/bin #adjust based on the location of usb stick mount
point
./mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n
Linux-2.6.32-5-kirkwood -d ../../boot/vmlinuz-2.6.32-5-kirkwood ../../boot/
uImage
./mkimage -A arm -O linux -T ramdisk -C gzip -a 0x0000000... 阅读全帖
g*****9
发帖数: 349
30
来自主题: Hardware版 - 大家都是用什么压缩软件?
以前用RAR,现在用命令行gzip,因为可以和linux沟通,另外支持单个文件分别压缩并
保持目录结构(gzip -vr),不知道winrar和7zip 是不是能实现类似功能呢?
o**n
发帖数: 1249
31
来自主题: Linux版 - 一个读doc里文档的小问题
很多*-doc的package都是在/usr/share 里面建一个folder,里面放了很多.gz的文档,
比如*.ps.gz, *.txt.gz,我要读的时候都是gzip解开再看,我觉得应该有不这么土的
办法,要不也不会这么多单独的文档偏要gzip上,正确的方法应该是怎么作阿?
E*V
发帖数: 17544
32
☆─────────────────────────────────────☆
nickmit (上海老姜) 于 (Wed Oct 27 01:52:51 2010, 美东) 提到:
先建个临时目录
# mkdir -p /tmp/ubuntu/maverick
没有 debootstrap 的先安装一下
# apt-get install debootstrap
然后构建基本系统,这里就用 10.10 吧,你也可以换 lucid
# debootstrap maverick /tmp/ubuntu/rootfs
基本设置一下
# chroot /tmp/ubuntu/rootfs
# mount -t proc none /proc
# mount -t devtmpfs none /dev
# mount -t devpts none /dev/pts
# mount -t sysfs none /sys
俺喜欢给 root 加个密码,sudo... 阅读全帖
F****3
发帖数: 1504
33
请完板上各位大牛有什么好的办法可以在服务器之间传送大量小文件吗?
目标文件在一个folder里面,folder里面有n多子文件夹。里面有n多小txt文件。
现在希望现在远程打包gzip之类,然后传送到本机服务器(不解压缩),请问应该怎么搞
啊?
rsync是不是只能传源文件,不能搞gzip。
g***l
发帖数: 2753
34
fedora 20, use dd to backup partitions. There are two partitions on the disk
/dev/sdb2 and /dev/sdb3
My usual image backup is as follows:
1. Mount and zero out the empty space:
dd if=/dev/zero of=temp.dd bs=1M
until full empty disk is wiped with zeros, then
rm temp.dd
2. dd the partition while compressing it:
dd if=/dev/sdb2 conv=sync,noerror bs=64K | gzip -c > /mnt/wine/sdb2.ddimg.gz
dd if=/dev/sdb3 conv=sync,noerror bs=64K | gzip -c > /mnt/wine/sdb3.ddimg.gz
But today when I tried to put the s... 阅读全帖
S*A
发帖数: 7142
35
你往硬盘写的时候不应该是 gzip -c
应该是 gzip -d 吧。这样你把硬盘压
两次写进去了。
BTW,你可以用 e2fsimage 来只备份
用到的扇区。
d****e
发帖数: 251
36
来自主题: Programming版 - 用python urlopen 抓mitbbs页面的问题
gzipped (maybe some of them based on your experience), you may use the gzip
module. You know what to do from there.
Good luck.
w****i
发帖数: 964
37
in python it's
import gzip
for line in gzip.open('file.gz'): blah_blah

much cleaner

of
some
all
b***i
发帖数: 3043
38
来自主题: Programming版 - C++11使用感受及一些问题
我们的嵌入式项目使用基本的串口,大概每秒一共<1KB的数据进来,需要处理和存储。
我们需要TCP/IP,需要流行的基本库,比如gzip, JSON等。我们使用Linux来解决底层
的库,现在说说对C++11的感受。
目前,按照几位高手的启发,现在Visual Studio 2015下实验,TCP/IP的同步异步都试
过了,多线程也很简单。
我们目标是使用Xilinx SDK,还没有安装最新的2015.3,只装了2015.2,是g++4.9.1,
所以支持C++11,不完全支持C++14。Xilinx SDK用过几小时,基于Eclipse。Visual
Studio里面我建立一个Solution,然后建立多个Project,互相依靠。不知道Xilinx SDK
是不是也这样,可否把程序模块化,分成多个项目?按说Eclipse就可以这样,一个
workspace多个项目。网上很少能查到Xilinx SDK的信息,包括g++版本只能安装后看。
我原来虚拟机下的g++才4.4,费了好大劲才升级成4.9.3。公司还不让git,不让
sourceforge下载源代码,连asio都是自己在家下然后发... 阅读全帖
h******b
发帖数: 6055
39
来自主题: Programming版 - 十个包子求助:NodeJS多线程?
用NodeJS写了一个简单的log file processor。 几百个gzip文档,每个压缩以后都有
半gig左右。
我用了nodejs的csv/zlib插件来stream这些文档,写成新的gzip。速度很慢,结果发现
CPU使用还不到15%,查了一下发现是因为nodejs同时只用一个core, 我公司的i7完全排
不上用场。
有什么简单的多线程处理方法吗?
k****i
发帖数: 101
40
来自主题: Programming版 - 十个包子求助:NodeJS多线程?
var fs = require('fs'),
zlib = require('zlib'),
csv = require('csv'),
P = require('paralleljs'),
ind = process.argv[2] + '/',
outd = process.argv[3] + '/',
files = fs.readdirSync(ind),
p = new P(files),
ins = function(file){return fs.createReadStream(ind+file)},
gnuzip = zlib.createGnuzip(),
parse = csv.parse(),
transform = csv.transform(function(rdata){/*todo*/}),
gzip = zip.createGzip(),
out = function(fil... 阅读全帖
k****i
发帖数: 101
41
来自主题: Programming版 - 十个包子求助:NodeJS多线程?
// tested, should work :)
(main = () => {
var cluster = require('cluster'),
fs = require('fs')
if (cluster.isMaster) {
(check = () => {
var mand = 'Usage: node thisScript inputDir outputDir ',
opt = '[optional: numberOfWorkerProcesses; default:
numberOfCpuCores]'
if (process.argv.length < 4) {
console.log(mand + opt)
process.exit(1)
}
})();
(schedule = () => {
var ind = process.argv[2],
files = fs... 阅读全帖
D*V
发帖数: 567
42
来自主题: Software版 - Winzip的命令行解压.gz文件的问题
全选tgz文件,然后用winrar/7zip解压不行么?
或者google unxtils,里面有gzip和tar,然后
gzip -dc whatever.tgz | tar -xv
q*****m
发帖数: 73
43
来自主题: Unix版 - How to creat .tar.gz?
he has gzip, and I assume he has gnu tar.
(assume you know gzip is gnu zip)
s****e
发帖数: 68
44
来自主题: Unix版 - *.ps.gz??
i dl some paper from online with *.ps.gz format.
i thought they are compressed files and tried to use
gzip or gnuzip to decompress but always comes out like
" they are not in gzip format"
then later i found they are simply postscript files or
some "compressed ps files" and can be viewed directly
by ghostview.
anyone knows why or what is it? thanks.
r****d
发帖数: 375
45
来自主题: Unix版 - Solaris 下如何对付大文件
I have such problem before when I tried to open some big traces. It seems that
gzip or tar can't handle such big file. So the way I did was using pipe, that
is: gzip -dc Yourfile.tar.gz | tar xv
p**z
发帖数: 65
46
不把笔记翻译成中文了,就直接贴了。
Example Python code below for creating the HDF5 file. Note uncompressed or '
gzip' compression type can be understood by both Matlab and HDFView.
from __future__ import division, print_function
import h5py
import numpy as np
data = np.array([('John', 35, 160.5), ('Mary', 20, 150)], dtype= [('Name', '
a10'), ('Age' ,'i'), ('Weight', 'f')])
##alternative:
#data = np.array([('John', 35, 160.5), ('Mary', 20, 150)], dtype = {'names':
['Name','Age','Weight'], 'formats':['a10','i','f'... 阅读全帖
A*******e
发帖数: 12486
47
来自主题: ChinaNews版 - 请直接联系谷歌!
中文名:悠悠花园 (在“谷歌”“百度”搜索引擎里输入“悠悠花园性
息”,可以查询到非常多的色情信息)
英文名:http://bbs.uugarden.com/82088_u.html
这家网站注册地在浙江省 ,Total 0.386706(s) query 6, Time now is:01-13 09:42,
Gzip enabled 浙ICP备32453627号
这个色情网站是目前国内最主要的几家色情非法网站之一,注册会员达到好几万人,组
织机构庞大,严密,非法牟取利益很长时间了。
r*****n
发帖数: 4844
48
前言
你是否觉得自己从学校毕业的时候只做过小玩具一样的程序?走入职场后哪怕没有什么
经验也可以把以下这些课外练习走一遍(朋友的抱怨:学校课程总是从理论出发,作业
项目都看不出有什么实际作用,不如从工作中的需求出发)
建议:
不要乱买书,不要乱追新技术新名词,基础的东西经过很长时间积累而且还会在未来至
少10年通用。
回顾一下历史,看看历史上时间线上技术的发展,你才能明白明天会是什么样。
一定要动手,例子不管多么简单,建议至少自己手敲一遍看看是否理解了里头的细枝末
节。
一定要学会思考,思考为什么要这样,而不是那样。还要举一反三地思考。
注:你也许会很奇怪为什么下面的东西很偏Unix/Linux,这是因为我觉得Windows下的
编程可能会在未来很没有前途,原因如下:
现在的用户界面几乎被两个东西主宰了,1)Web,2)移动设备iOS或Android。Windows
的图形界面不吃香了。
越来越多的企业在用成本低性能高的Linux和各种开源技术来构架其系统,Windows的成
本太高了。
微软的东西变得太快了,很不持久,他们完全是在玩弄程序员。详情参见《Windows编
程革命史》
所以... 阅读全帖
s****i
发帖数: 2993
c***l
发帖数: 2490
50
一直一来,缺芯少魂一直是中国信息产业的心病,中国的CPU市场也一直被Intel、ARM
等国外厂商垄断,龙芯、申威、飞腾等国产CPU在社会上也往往遭到别有用心之徒诸如
“打磨芯片”、“骗经费”、“政绩工程”等舆论抨击。不久前,采用申威26010的神
威太湖之光在TOP500刷榜,飞腾也公布了采用ARM指令集的飞腾1500A和飞腾2000,龙芯
的3A3000也顺利完成流片,那么这些国产CPU的性能到底如何呢?
如何评价CPU
如何评价CPU的性能呢?从体系结构的角度来看,有个指标叫MIPS,即每分钟执行多少
条指令,执行指令数量越多,性能就越好,但这存在一个问题,当CPU指令集不同的时
候,比较MIPS就意义不大了——比如A一条指令只算一个加法,B一条指令能做一个1024
点的FFT。特别是在不同指令集的情况下,如何评价CPU的性能呢?
评价CPU性能必须考虑应用的多样性,比如科学运算重视双精浮点性能,但是如果数据
供不上,运算能力再强也没用;比如PC日常使用更偏重于定点性能;再比如计算中心多
任务环境关注的是吞吐率......因此单纯用某一个指标来衡量CPU性能是不科学的,必
须综合... 阅读全帖
1 2 3 4 下页 末页 (共4页)