Binary.setBlockData(3kaya) Kaya module reference Binary.setBlockData(3kaya)NAME
Binary::setBlockData - Set the contents of a block.
SYNOPSIS
Void setBlockData( var Binary block, Int offset, [Int] bdata )
ARGUMENTS
block The binary block
offset The offset to start at (zero-indexed)
bdata The data to write, as an array of Int s
DESCRIPTION
Set the contents of (part of) a block from an array. An Binary.OffsetOutOfRange(3kaya) Exception will be thrown if this would cause a
write outside the bounds of the block. The following bits of code are equivalent:
setBlockData(block,offset,bdata);
// is equivalent to
for byte@idx in bdata {
poke(block,offset+idx,byte);
}
However, setBlockData is more efficient and checks bounds before any data is written - the above for loop could write partial data if off-
set+idx was greater than blockSize(block)
AUTHORS
Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/
LICENSE
The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
License (version 2.1 or any later version) as published by the Free Software Foundation.
RELATED Binary.Binary(3kaya)Binary.array(3kaya)Binary.copyBlock(3kaya)Binary.getBlockChunk(3kaya)Binary.poke(3kaya)Binary.pokeString(3kaya)Kaya October 2012 Binary.setBlockData(3kaya)
Check Out this Related Man Page
Binary.pokeString(3kaya) Kaya module reference Binary.pokeString(3kaya)NAME
Binary::pokeString - Write a String of binary data.
SYNOPSIS
Void pokeString( var Binary block, Int offset, String val )
ARGUMENTS
block The binary block
offset The location to write to (starting from zero)
val The String to write.
DESCRIPTION
Poke the string val into the block, starting at offset offset
An Binary.OffsetOutOfRange(3kaya) exception will be thrown if it attempts to access a value outside the block. Note that the String will
be stored in the block in UTF-8 encoding, not as raw Kaya chars, so you need to use Builtins.byteLength(3kaya) to determine how much space
you need (and then add one for a terminating null byte).
AUTHORS
Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/
LICENSE
The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
License (version 2.1 or any later version) as published by the Free Software Foundation.
RELATED Binary.Binary(3kaya)Builtins.byteLength(3kaya)Binary.peekString(3kaya)Binary.poke(3kaya)Binary.setBlockData(3kaya)Kaya October 2012 Binary.pokeString(3kaya)
Hi All,
I have a Binary file and I want to read the file
and write as ASCII.
If anybody knows the method, please mail me to :
kkodava@maxis.com
Thanks
Krishna (4 Replies)
Hi guys,
I need to write a script that will list all the files in the current diretory which are identical to a filename that the user enters using binary comparison, but I'm not entirely sure how to go about it. It's part of a larger script of system administration tools but I just can't find... (3 Replies)
Dear Experts
I need to read a binary file. I know for example in byte number 3801-3804 there is a 4 byte number embeded. Is there a way to extract this number from this file and then convert it to ascii via unix??
Your help would be highly appreciated.
Very Best Regards
Reza (5 Replies)
I want to verify the file is Binary or ascii file and accordingly I want to switch the program with ret code
ie 0 or success and 1 for failure
Can any one help me is this a correct syntex...i am getting error
#!/bin/ksh
$file filename
if
echo "ascii fie Found"
else
echo " binary... (6 Replies)
Hi All,
Currently i have to write a script.
For which i need to cut a block from .txt file.
I know the specific word that starts the block and ends the block.
Can we do it in shell scripting..?
Please suggest.... (6 Replies)
Hi All,
I have a ln between two files (say ln a b), when i truncate file " b ", this truncates file " a " also, a binary line is being added as the first line of both the files.
This is causing problems with other scripts which grep on the above files.
(though i can work my way around... (4 Replies)
Hi All,Is there anyway I can conver the binary file to ascii. I don't know the binary file format. file command just lists this as "data" file and when I view it has a lot of non-printable characters.Can I write any command equivalent to wc -l to find out the number of rows in the file?Can I use... (4 Replies)
Dear Experts,
I have one binary file which contains multiple 31k (31744) records.
Each record begins with "a6 82".
So the pattern is:
a6 82 (+31742 bytes)
a6 82 (+31742 bytes)
a6 82 (+31742 bytes)
a6 82 (+31742 bytes)
There are some corrupted files where record does... (6 Replies)
Hello to all in forum,
Please your help with this.
I have a binary file that is represented in Binary or Binary Coded Decimal (BCD).
Do you know a parser for this kind of binary files?
I have the structure format, but I don't know how and where to begin.
You answer would be very... (15 Replies)
Hi Guys,
Is it possible to convert the hexadecimal to Binary by unix command.....I could not figure out....
If I need to convert AF6D to binary...what could be the way to do?
Thanks in advance!!
---------- Post updated at 02:57 AM ---------- Previous update was at 02:42 AM ----------
I... (6 Replies)
Hello,
I have script which work fine on particular data.file .
The next feature I want to achieve is to get the decimal equivalent of data to data.
The data looks like this :
data(01000000000000000000110000000000)
thank you..
#include <iostream>
#include <fstream>
#include... (4 Replies)
Hello All,
I need to read values from database and then need to write to a file. Planning to do that as binary since no one can modify the values. We tried to write the file in "B" mode and the file is created but when I try to open in notepad I am able to do. I there a way that someone should... (4 Replies)
Hi guys and gals...
I am now beyond the limits of my POSIX knowledge here.
Below is a piece of code that runs perfectly well on small string lengths, BYTE sizes up to around 1KB, (3KB of octal text).
It generates byte vlues from 0x00 to 0xFF.
It passes Shell Check's requirements and... (6 Replies)