src/StreamletAttributeFinder.h
branchv_0
changeset 51 841845ccf06d
parent 48 26a8b1a14889
child 60 bb7ca5891755
equal deleted inserted replaced
50:22ed5647b235 51:841845ccf06d
    72 	string_t getStreamletCommand(const RequestedField& field) {
    72 	string_t getStreamletCommand(const RequestedField& field) {
    73 		const char* streamletPathChars = getenv("RELPIPE_IN_FILESYSTEM_STREAMLET_PATH");
    73 		const char* streamletPathChars = getenv("RELPIPE_IN_FILESYSTEM_STREAMLET_PATH");
    74 		if (streamletPathChars) {
    74 		if (streamletPathChars) {
    75 			for (string_t path : splitBySeparator(convertor.from_bytes(streamletPathChars))) {
    75 			for (string_t path : splitBySeparator(convertor.from_bytes(streamletPathChars))) {
    76 				fs::path file = fs::path(path) / fs::path(field.name);
    76 				fs::path file = fs::path(path) / fs::path(field.name);
    77 				if (fs::exists(file) && ::access(file.c_str(), X_OK) == 0) return file.wstring();
    77 				if (fs::exists(file) && ::access(file.c_str(), X_OK) == 0) return file.wstring();  // n.b. must be set executable using e.g. chmod – files executable through only ACL, are actually not executable
    78 			}
    78 			}
    79 			throw RelpipeWriterException(L"Streamlet „" + field.name + L"“ was not found at $RELPIPE_IN_FILESYSTEM_STREAMLET_PATH");
    79 			throw RelpipeWriterException(L"Streamlet „" + field.name + L"“ was not found at $RELPIPE_IN_FILESYSTEM_STREAMLET_PATH");
    80 		} else {
    80 		} else {
    81 			throw RelpipeWriterException(L"Missing environment variable RELPIPE_IN_FILESYSTEM_STREAMLET_PATH → unable to find streamlet.");
    81 			throw RelpipeWriterException(L"Missing environment variable RELPIPE_IN_FILESYSTEM_STREAMLET_PATH → unable to find streamlet.");
    82 		}
    82 		}