Solved

Cant write IStream::Write due to insufficient disk space

Posted on 2002-05-06
6
1,062 Views
Last Modified: 2012-05-04
Hi!
I'm working on VC++ on windows 2000.
Anyway I have used OpenStreamOnFile to get an IStream pointer to
an XML file. When I tried to write to the Istream it returned
Error: 0x80030070 - There is insufficient disk space.
There is no problem of disk space on my hard drive of course.
Anyone got a clue why IStream::Save is failing ?

The code goes like that:



HRESULT     hr = OpenStreamOnFile (MAPIAllocateBuffer, MAPIFreeBuffer,STGM_READ | STGM_WRITE, xmlFile, NULL, &pXmlStream);

char buff[100]="Hello";

LARGE_INTEGER li = {0, 0};
HRESULT _hh = pXmlStream->Seek(li,STREAM_SEEK_SET,NULL);
         
unsigned long  x;
hr  = pXmlStream->Write(buff,5,&x);


Thanks you.
0
Comment
Question by:ronibr
6 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 6991422
You initialization of 'LARGE_INTEGER' seems a bit 'problematic' - try

__int64 i = 0;

LARGE_INTEGER li;

li.QuadPart = i;

HRESULT _hh = pXmlStream->Seek(li,STREAM_SEEK_SET,NULL);

BTW, you do not have to seek to the beginning of a file you open...
0
 

Author Comment

by:ronibr
ID: 6991430
Its not connected in any way to the pXmlStream->Seek.
HRESULT from seek is 0 (success) and even without
the Seek it fails with the same problem.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6991456
Hmm, is the file you are opening read-only? (Yes, it'd be a stupid error code, but...)
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 49

Expert Comment

by:DanRollins
ID: 7044032
hi ronibr,
Are you still interested in solving this problem?  If so, post the failing code (the code that returns the error hr)  Writing to one of these kind of streams is trickier than it looks...

-- Dan
0
 
LVL 11

Expert Comment

by:griessh
ID: 7178518
Dear ronibr

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to

     "PAQ at zero points"

since you never gave more feedback.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
ID: 7199749
moved to PAQ

** Mindphaser - Community Support Moderator **
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question