Skip to content
This repository has been archived by the owner on Jun 20, 2020. It is now read-only.

Fixing Handle and its subclasses #2

Closed
bugravirgomercury opened this issue Mar 27, 2020 · 3 comments
Closed

Fixing Handle and its subclasses #2

bugravirgomercury opened this issue Mar 27, 2020 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed invalid This doesn't seem right

Comments

@bugravirgomercury
Copy link
Owner

I'm trying to test FileHandle class, but it doesn't work as expected. It fails with invalid handle exception.

/*
 * This is a scratch-pad file for writing some tests of Virgo.
 */

#include <windows.h>
#include <iostream>
#include "../Include/FileHandle.h"

int main(int argc, const char* argv[])
{
	char virgo[] = "virgo!";
	Virgo::FileHandle handle{ "virgo.txt", "wx" };
	handle.Write(virgo, 0, sizeof(virgo));
	handle.Close();
	// the virgo.txt file should contain "virgo!" text.
	return 0;
}
@bugravirgomercury bugravirgomercury added bug Something isn't working help wanted Extra attention is needed invalid This doesn't seem right labels Mar 27, 2020
@bugravirgomercury bugravirgomercury pinned this issue Mar 28, 2020
@bugravirgomercury
Copy link
Owner Author

I'll rewrite the class from scratch, will it work?

@bugravirgomercury
Copy link
Owner Author

I should stop reinventing the wheel and use the std's fstream instead. [I'll add a hstream class instead for stream-like handles]

@bugravirgomercury
Copy link
Owner Author

I've got rid of that bug from now on. What remains is adding some wrapper for easier file creation from handles.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant