binaryfiles

How to change a file inside an archive (.ear) file without extracting entire file

萝らか妹 提交于 2020-01-16 04:09:05
问题 I have an .ear file (an archive file like tar / zip) that has a file inside that i want to change. For example myfile.ear contains 1.txt and i want to change 1.txt to 2.txt and possibly also change some of the content inside 1.txt (like sed does) I really want to avoid having to extract myfile.ear , change the file and compress it again. Does anyone know a way to achieve this in linux ? And if it's not possible, I would also like to know why Thanks. 回答1: EAR files are just JAR files which are

What is the difference between FileSink, StringSink, Filesource, StringSource Crypto++

北战南征 提交于 2020-01-15 20:15:06
问题 I am reading in an image, encrypting it, then decrypting it. The goal is to be looping this eventually and recording the time it takes for the process to complete. Currently what I have it reads the file in, then it encrypts it, encrypts it, the creates another file based on the recovered data. I don't need to make another file with the decrypted picture. Previously I had been using StringSource and StringSink , but that only worked for text files. I received some help at How to read an image

How to concatenate binary file using ADODB.stream in VBscript

久未见 提交于 2020-01-14 13:14:50
问题 Hi guys i have to concatenate 3 binary file into one but i m getting an error while i try it here is my code ' This is a simple example of managing binary files in ' vbscript using the ADODB object dim inStream,outStream const adTypeText=2 const adTypeBinary=1 ' We can create the scream object directly, it does not ' need to be built from a record set or anything like that set inStream=WScript.CreateObject("ADODB.Stream") ' We call open on the stream with no arguments. This makes ' the stream

How to concatenate binary file using ADODB.stream in VBscript

左心房为你撑大大i 提交于 2020-01-14 13:14:09
问题 Hi guys i have to concatenate 3 binary file into one but i m getting an error while i try it here is my code ' This is a simple example of managing binary files in ' vbscript using the ADODB object dim inStream,outStream const adTypeText=2 const adTypeBinary=1 ' We can create the scream object directly, it does not ' need to be built from a record set or anything like that set inStream=WScript.CreateObject("ADODB.Stream") ' We call open on the stream with no arguments. This makes ' the stream

How to concatenate binary file using ADODB.stream in VBscript

淺唱寂寞╮ 提交于 2020-01-14 13:10:05
问题 Hi guys i have to concatenate 3 binary file into one but i m getting an error while i try it here is my code ' This is a simple example of managing binary files in ' vbscript using the ADODB object dim inStream,outStream const adTypeText=2 const adTypeBinary=1 ' We can create the scream object directly, it does not ' need to be built from a record set or anything like that set inStream=WScript.CreateObject("ADODB.Stream") ' We call open on the stream with no arguments. This makes ' the stream

binary encoding for JSON?

那年仲夏 提交于 2020-01-13 04:48:31
问题 My Javascript application is downloading quite a bit of data from the server and I was thinking that in addition to normal gzip that's done by the server, I can encode the data in some binary format rather than textual JSON. Is there a standard way of doing this? Ideally it should be some small tool that can take a JSON text file and convert it to a generic binary format and a small Javascript library which decodes it. Also, is there something special that needs to be done in XHR to pass

How to download a file through a custom POST request with CasperJS

无人久伴 提交于 2020-01-11 11:42:36
问题 I am writing a crawler and needs to download file generated after a form request using POST. I have successfully used this.download(url,'POST',Params) for regular forms. One of the sites has many fields using the same name, thus preventing me from using the regular download method. After trying a lot of things, I tried with $.ajax() and __utils.sendAJAX() to process the form like this: response = this.evaluate(function(){ url=... params = $('form#theirForm').serialize(); data = __utils__

Write numbers to a file in lua in binary format

久未见 提交于 2020-01-11 08:28:08
问题 I have a big array with numbers I would like to write to a file. But if I do this: local out = io.open("file.bin", "wb") local i = 4324234 out:write(i) I am just writing the number as a string to the file. How do I write the correct bytes for the number to file. And how can I later read from it. 回答1: Try this function writebytes(f,x) local b4=string.char(x%256) x=(x-x%256)/256 local b3=string.char(x%256) x=(x-x%256)/256 local b2=string.char(x%256) x=(x-x%256)/256 local b1=string.char(x%256) x

How to open and read a binary file in Python?

江枫思渺然 提交于 2020-01-07 09:58:49
问题 I have a binary file (link) that I would like to open and read contents of with Python. How are such binary files opened and read with Python? Any specific modules to use for such an operation. 回答1: The 'b' flag will get python to treat the file as a binary, so no modules are needed. Also you haven't provided a purpose for having python read a binary file with a question like that. f = open('binaryfile', 'rb') print(f.read()) 回答2: Here is an Example: with open('somefile.bin', 'rb') as f: #the

How to open and read a binary file in Python?

北城余情 提交于 2020-01-07 09:58:48
问题 I have a binary file (link) that I would like to open and read contents of with Python. How are such binary files opened and read with Python? Any specific modules to use for such an operation. 回答1: The 'b' flag will get python to treat the file as a binary, so no modules are needed. Also you haven't provided a purpose for having python read a binary file with a question like that. f = open('binaryfile', 'rb') print(f.read()) 回答2: Here is an Example: with open('somefile.bin', 'rb') as f: #the