help-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Writing to a disk


From: bertrand . sirodot
Subject: Writing to a disk
Date: Fri, 15 Jun 2001 17:10:42 +0100

Hi everybody,

I am trying to learn how to write a translator so I am trying to write a
translator that will write stuff to a disk. By using the storeread example,
I have been able to read data from a disk, but now, I am trying to write to
it and it doesn't work.
In summary, here is whate I am doing:
     char buf[] = "Hello, world !";
      file = file_name_lookup(argv[1], O_NOLINK, 0); /* argv[1] being the
device name i.e. /dev/sd2s2 */
     err = store_open(file, O_RDWR, STORAGE_DEVICE, &store);
     store_write(store, 0, buf, sizeof(buf), &amount);  /* stuff being what
I want to write */
     store_free(store);

The error message I get is:
     test_store: ../../libstore/rdwr.c:111: store_write: Assertion '(len &
(store->block_size - 1)) == 0' failed.

The store I am trying to write to has a block size of 512 and the size of
buf is 14. When we use the store_write inteerface, does the size of the ios
need to be a factor of the block size?
Otherwise, what is the way of achieving this?

Thank you very much in advance for the answers.
Bertrand.



___________________________________________________________

This message and any attachments (the "message") is intended solely for
the addressees and is confidential.  If you receive this message in error,
please delete it and immediately notify the sender.

Any use not in accord with its purpose, any dissemination or disclosure,
either whole or partial, is prohibited except formal approval.

The internet can not guarantee the integrity of this message.  BNP PARIBAS
(and its subsidiaries) shall (will) not therefore be liable for the message
if modified.
                       --------------------------------------------------
Ce message et toutes les pieces jointes (ci-apres le "message") sont
etablis a l'intention exclusive de ses destinataires et sint confidentiels.
Si vous recevez ce message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur.

Toute utilisation de ce message non conforme a sa destination, toute
diffusion ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse.

L'internet ne permettant pas d'assurer l'integrite de ce message, BNP
PARIBAS (et ses filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.
___________________________________________________________



reply via email to

[Prev in Thread] Current Thread [Next in Thread]