MCPcopy Create free account
hub / github.com/devkitPro/libctru / FSUSER_CreateFile

Function FSUSER_CreateFile

libctru/source/services/fs.c:294–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294Result FSUSER_CreateFile(FS_Archive archive, FS_Path path, u32 attributes, u64 fileSize)
295{
296 u32 *cmdbuf = getThreadCommandBuffer();
297
298 cmdbuf[0] = IPC_MakeHeader(0x808,8,2); // 0x8080202
299 cmdbuf[1] = 0;
300 cmdbuf[2] = (u32) archive;
301 cmdbuf[3] = (u32) (archive >> 32);
302 cmdbuf[4] = path.type;
303 cmdbuf[5] = path.size;
304 cmdbuf[6] = attributes;
305 cmdbuf[7] = (u32) fileSize;
306 cmdbuf[8] = (u32) (fileSize >> 32);
307 cmdbuf[9] = IPC_Desc_StaticBuffer(path.size, 0);
308 cmdbuf[10] = (u32) path.data;
309
310 Result ret = 0;
311 if(R_FAILED(ret = svcSendSyncRequest(fsSessionForArchive(archive)))) return ret;
312
313 return cmdbuf[1];
314}
315
316Result FSUSER_CreateDirectory(FS_Archive archive, FS_Path path, u32 attributes)
317{

Callers 1

archive_openFunction · 0.85

Calls 4

getThreadCommandBufferFunction · 0.85
IPC_MakeHeaderFunction · 0.85
IPC_Desc_StaticBufferFunction · 0.85
fsSessionForArchiveFunction · 0.85

Tested by

no test coverage detected