We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f956aab commit 5d9a182Copy full SHA for 5d9a182
ggml/src/ggml.c
@@ -556,6 +556,16 @@ FILE * ggml_fopen(const char * fname, const char * mode) {
556
557
return file;
558
#else
559
+ // if file does not have a path, we assume it's a file descriptor
560
+ if (strchr(fname, '/') == NULL) {
561
+ char *endptr;
562
+ long num = strtol(fname, &endptr, 10);
563
+ FILE *file = fdopen(dup(num), mode);
564
+
565
+ if (file != NULL) {
566
+ return file;
567
+ }
568
569
return fopen(fname, mode);
570
#endif
571
0 commit comments