application/octet-streamJust a little thing, to send a binary file how should i set Content-Type ?
application/octet-streamJust a little thing, to send a binary file how should i set Content-Type ?
Hey, Voxel here with yet another question...
Is there a way to read specific parts of a text file? for example, reading and printing a word from the middle of a sentence. Thank you for any answers.
Still have no idea, but thanks anyway. (I'll take a look at some sources and see if that helps..)copy the file content into a buffer using standard file i/o and then search the word you need into that buffer. If the file is too big don't copy it entirely, it would be SO slow (you could divide the file into different chunks, for example)
Additional challenge: load the chunks and search into them with different threads and you will have the faster search function in the homebrew scene!
Still have no idea, but thanks anyway. (I'll take a look at some sources and see if that helps..)
Well, I guess it is very similar to your general i/o in C, since you have your strlen, fgets, sizeof functions etc. and I am confident with using all of those once I look at examples (like I did just now).Would i be rude suggesting to change the approach here? Looking at source code from experienced programmers without understanding the bases will result in a working code (maybe) and in a confuse coder. I pointed you in the right direction, follow that direction all by yourself, it will take some time but it will make you skillful.
Start learning about standard file io in c/c++ and everything will come naturally, i assure
Is there a errorcodes database?
When trying to open a file in savedata archive i get this error: -931117979
I don't know if it is available anywhere else (never found it) but you should get a general error description by logging into #3dsdev on irc and writing !err 0xERRORNUMBER
(be sure to write the error number in hex)
Well, I guess it is very similar to your general i/o in C, since you have your strlen, fgets, sizeof functions etc. and I am confident with using all of those once I look at examples (like I did just now).
MMmmmhhh could it be related to the fact i need two archives to be opened? It looks like with latest changes in ctrulib, handles are no more supported so maybe the problem could came from this.
Sorry. they're to do with reading the files, aren't they.strlen is a c string function, sizeof is in the core of the language. They have nothing to do with file i/o
What if i want to open both archives with fs instead of using normal I/O C functions?
Going to use C I/O.
How can i delete a file in sdmc without using FS so? remove?
Never tried but the remove(char* path) function from <stdio.h> should do the trick, Never tried using it but every other stdio.h function is working well on 3ds
Result ret = FSUSER_OpenFile(&output, saveArchive, filePath, FS_OPEN_READ, 0x00000000);
if (ret == 0){
FSFILE_Close(output);
svcCloseHandle(output);
FSUSER_DeleteFile(saveArchive, filePath);
}
ret = FSUSER_OpenFile( &output, saveArchive, filePath, FS_OPEN_WRITE | FS_OPEN_CREATE, 0x00000000);
if (ret != 0){
printf("ERROR (%i)\n\n", ret);
printf("Press B to continue.");
gfxFlushBuffers();
while(!(hidKeysDown() & KEY_B)) hidScanInput();
return;
}else printf("Done!\nWriting savegame... ");
gfxFlushBuffers();
FSFILE_Write(output, NULL, 0, buffer, fileSize, 0x10001);
FSFILE_Close(output);
svcCloseHandle(output);
printf("Done!\n");
gfxFlushBuffers();
Yep, it looks it's working good. Now i don't have any error but it looks like savegame is not touched
The changes to the save file must be committed using FSUSER_ControlArchive otherwise they get lost, look here: https://github.com/Slashcash/PCHex-plusplus/blob/master/source/filesystem.cpp#L160 (no necessity to call it after every write operation, though)
Is there a errorcodes database?
When trying to open a file in savedata archive i get this error: -931117979