Sponsored Content
Top Forums Programming Serialization of a char buffer Post 302712659 by Corona688 on Tuesday 9th of October 2012 12:55:38 PM
Old 10-09-2012
Write it to a file.

Then read the file back.

It's just an array of bytes.
 

8 More Discussions You Might Find Interesting

1. Programming

How to achieve Serialization in Unix C, C++

How to achieve SERIALIZATION in Unix , C, C++ Write Objects directly to disk and read back ? (1 Reply)
Discussion started by: Sivaswami
1 Replies

2. Shell Programming and Scripting

How to replace any char with newline char.

Hi, How to replace any character in a file with a newline character using sed .. Ex: To replace ',' with newline Input: abcd,efgh,ijkl,mnop Output: abcd efgh ijkl mnop Thnx in advance. Regards, Sasidhar (5 Replies)
Discussion started by: mightysam
5 Replies

3. Programming

Adding a single char to a char pointer.

Hello, I'm trying to write a method which will return the extension of a file given the file's name, e.g. test.txt should return txt. I'm using C so am limited to char pointers and arrays. Here is the code as I have it: char* getext(char *file) { char *extension; int i, j;... (5 Replies)
Discussion started by: pallak7
5 Replies

4. Programming

concat const char * with char *

hello everybody! i have aproblem! i dont know how to concatenate const char* with char const char *buffer; char *b; sprintf(b,"result.txt"); strcat(buffer,b); thanx in advance (4 Replies)
Discussion started by: nicos
4 Replies

5. Shell Programming and Scripting

how first char in odd line and second char in even line

Hi I m having ifconfig -a o/p like sbanlab1:ksh# ifconfig -a | egrep "flags|inet" | awk -F' ' '{print $1,$2}' lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> inet 127.0.0.1 lo0:1: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> inet 127.0.0.1 bge0:... (1 Reply)
Discussion started by: tarunn.dubeyy
1 Replies

6. Programming

error: invalid conversion from ‘const char*’ to ‘char*’

Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially): xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’: xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’ The same error with all c++ constructors - gcc 4.4.4. If anyone can throw any light on... (8 Replies)
Discussion started by: GSO
8 Replies

7. Programming

Special char in a buffer

Hello, Please ,how can verify, if a case of buffer contains a special char ? (in C) Thank you. (3 Replies)
Discussion started by: chercheur857
3 Replies

8. Programming

Invalid conversion from char* to char

Pointers are seeming to get the best of me and I get that error in my program. Here is the code #include <stdio.h> #include <stdlib.h> #include <string.h> #define REPORTHEADING1 " Employee Pay Hours Gross Tax Net\n" #define REPORTHEADING2 " Name ... (1 Reply)
Discussion started by: Plum
1 Replies
PHP::Serialization(3pm) 				User Contributed Perl Documentation				   PHP::Serialization(3pm)

NAME
PHP::Serialization - simple flexible means of converting the output of PHP's serialize() into the equivalent Perl memory structure, and vice versa. SYNOPSIS
use PHP::Serialization qw(serialize unserialize); my $encoded = serialize({ a => 1, b => 2}); my $hashref = unserialize($encoded); DESCRIPTION
Provides a simple, quick means of serializing perl memory structures (including object data!) into a format that PHP can deserialize() and access, and vice versa. NOTE: Converts PHP arrays into Perl Arrays when the PHP array used exclusively numeric indexes, and into Perl Hashes then the PHP array did not. FUNCTIONS
Exportable functions.. serialize($var,[optional $asString,[optional $sortHashes]]) Serializes the memory structure pointed to by $var, and returns a scalar value of encoded data. If the optional $asString is true, $var will be encoded as string if it is double or float. If the optional $sortHashes is true, all hashes will be sorted before serialization. NOTE: Will recursively encode objects, hashes, arrays, etc. SEE ALSO: ->encode() unserialize($encoded,[optional CLASS]) Deserializes the encoded data in $encoded, and returns a value (be it a hashref, arrayref, scalar, etc) representing the data structure serialized in $encoded_string. If the optional CLASS is specified, any objects are blessed into CLASS::$serialized_class. Otherwise, O bjects are blessed into PHP::Serialization::Object::$serialized_class. (which has no methods) SEE ALSO: ->decode() METHODS
Functionality available if using the object interface.. decode($encoded_string,[optional CLASS]) Deserializes the encoded data in $encoded, and returns a value (be it a hashref, arrayref, scalar, etc) representing the data structure serialized in $encoded_string. If the optional CLASS is specified, any objects are blessed into CLASS::$serialized_class. Otherwise, Objects are blessed into PHP::Serialization::Object::$serialized_class. (which has no methods) SEE ALSO: unserialize() encode($reference,[optional $asString,[optional $sortHashes]]) Serializes the memory structure pointed to by $reference, and returns a scalar value of encoded data. If the optional $asString is true, $reference will be encoded as string if it is double or float. If the optional $sortHashes is true, all hashes will be sorted before serialization. NOTE: Will recursively encode objects, hashes, arrays, etc. SEE ALSO: serialize() TODO
Support diffrent object types AUTHOR INFORMATION
Copyright (c) 2003 Jesse Brown <jbrown@cpan.org>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Various patches contributed by assorted authors on rt.cpan.org (as detailed in Changes file). Currently maintained by Tomas Doran <bobtfish@bobtfish.net>. Rewritten to solve all known bugs by BjA~Xrn-Olav Strand <bolav@cpan.org> perl v5.10.1 2010-03-18 PHP::Serialization(3pm)
All times are GMT -4. The time now is 04:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy