Ejemplo n.º 1
0
							xsResult = xsCall1(xsGet(xsGlobal, xsID("JSON")), xsID("stringify"), xsResult);
							message->response.body = FskStrDoCopy(xsToString(xsResult));
							message->response.size = FskStrLen(message->response.body);
							KprMessageTransform(message, gFILEService.machine);
						}
						xsCatch {
						}
					}
				}
				xsEndHostSandboxCode();
			}
			else if (kFskDirectoryItemIsFile == info.filetype) {
				KprStream stream = message->stream;
				FskInt64 size;
				bailIfError(FskFileOpen(path, kFskFilePermissionReadOnly, &fref));
				bailIfError(FskFileGetSize(fref, &size));
				bailIfError(FskMemPtrNew(size, &message->response.body));
				bailIfError(FskFileRead(fref, size, message->response.body, &message->response.size));
				if (stream && stream->dispatch->receive) {
					(*stream->dispatch->receive)(stream, message, gFILEService.machine, message->response.body, message->response.size);
					FskMemPtrDisposeAt(&message->response.body);
					message->response.size = 0;
				}
				KprMessageTransform(message, gFILEService.machine);
			}
			else
				err = kFskErrUnimplemented;
		}
		else
			err = kFskErrUnimplemented;
	bail:
Ejemplo n.º 2
0
FskErr KprSoundLoadSpoolerGetSize(FskMediaSpooler spooler, FskInt64 *size)
{
	KprSoundLoadSpoolerRefcon refcon = spooler->refcon;
	return FskFileGetSize(refcon->fref, size);
}