PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.php > Write a binary file
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Write a binary file

Réponse
 
LinkBack Outils de la discussion
Vieux 08/12/2007, 20h30   #1
zach
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Write a binary file

Can someone me out, I can't figure out what I'm doing wrong to
write to a file in binary mode.

What's wrong with my code?

<?php

$fileName = "something.dat";
$string = "This is a string of text";

$ptr = fopen($fileName, 'wb');

fwrite($ptr, $string);
fclose($ptr);

?>
  Réponse avec citation
Vieux 08/12/2007, 23h57   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Write a binary file

zach wrote:
> Can someone me out, I can't figure out what I'm doing wrong to
> write to a file in binary mode.
>
> What's wrong with my code?
>
> <?php
>
> $fileName = "something.dat";
> $string = "This is a string of text";
>
> $ptr = fopen($fileName, 'wb');
>
> fwrite($ptr, $string);
> fclose($ptr);
>
> ?>
>


What kind of error messages do you get? Or what result indicates you
aren't writing the data correctly?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 09/12/2007, 00h20   #3
zach
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Write a binary file

Jerry Stuckle wrote:
> zach wrote:
>> Can someone me out, I can't figure out what I'm doing wrong to
>> write to a file in binary mode.
>>
>> What's wrong with my code?
>>
>> <?php
>>
>> $fileName = "something.dat";
>> $string = "This is a string of text";
>>
>> $ptr = fopen($fileName, 'wb');
>>
>> fwrite($ptr, $string);
>> fclose($ptr);
>>
>> ?>
>>

>
> What kind of error messages do you get? Or what result indicates you
> aren't writing the data correctly?
>

I got a reply from Rik in another php forum already. I wasn't getting an
error but I was mistaken on how a binary file should look. I expected it
to look differently than just plain old ascii text and it didn't. Thanks
for replying.
  Réponse avec citation
Vieux 09/12/2007, 00h23   #4
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Write a binary file

zach wrote:
> Jerry Stuckle wrote:
>> zach wrote:
>>> Can someone me out, I can't figure out what I'm doing wrong to
>>> write to a file in binary mode.
>>>
>>> What's wrong with my code?
>>>
>>> <?php
>>>
>>> $fileName = "something.dat";
>>> $string = "This is a string of text";
>>>
>>> $ptr = fopen($fileName, 'wb');
>>>
>>> fwrite($ptr, $string);
>>> fclose($ptr);
>>>
>>> ?>
>>>

>>
>> What kind of error messages do you get? Or what result indicates you
>> aren't writing the data correctly?
>>

> I got a reply from Rik in another php forum already. I wasn't getting an
> error but I was mistaken on how a binary file should look. I expected it
> to look differently than just plain old ascii text and it didn't. Thanks
> for replying.
>


This problem won't occur if you cross-post instead of multi-posting.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 09/12/2007, 01h28   #5
zach
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Write a binary file

Jerry Stuckle wrote:
> zach wrote:
>> Jerry Stuckle wrote:
>>> zach wrote:
>>>> Can someone me out, I can't figure out what I'm doing wrong to
>>>> write to a file in binary mode.
>>>>
>>>> What's wrong with my code?
>>>>
>>>> <?php
>>>>
>>>> $fileName = "something.dat";
>>>> $string = "This is a string of text";
>>>>
>>>> $ptr = fopen($fileName, 'wb');
>>>>
>>>> fwrite($ptr, $string);
>>>> fclose($ptr);
>>>>
>>>> ?>
>>>>
>>>
>>> What kind of error messages do you get? Or what result indicates you
>>> aren't writing the data correctly?
>>>

>> I got a reply from Rik in another php forum already. I wasn't getting
>> an error but I was mistaken on how a binary file should look. I
>> expected it to look differently than just plain old ascii text and it
>> didn't. Thanks for replying.
>>

>
> This problem won't occur if you cross-post instead of multi-posting.
>

Sorry but I don't know what cross posting is. I'll look it up though.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 09h35.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09918 seconds with 13 queries