change error message of failed path_abs

This commit is contained in:
dzaima 2023-07-16 16:26:16 +03:00
parent cf6a290e5c
commit 6305a3bd50
2 changed files with 6 additions and 2 deletions

View File

@ -185,7 +185,7 @@ B path_abs(B path) {
toUTF8(path, p);
p[plen] = 0;
char* res = realpath(p, NULL);
if (res==NULL) thrF("Failed to convert %R to absolute path", path);
if (res==NULL) thrF("Failed to resolve \"%R\": %S", path, strerror(errno));
B r = utf8Decode0(res);
free(res);
dec(path);

View File

@ -1,4 +1,4 @@
# not tested here: •Out •Show •Exit •term •GetLine •Cmp •CurrentError •FFI •internal.HeapDump •file.MapBytes •file.RealPath
# not tested here: •Out •Show •Exit •term •GetLine •Cmp •CurrentError •FFI •internal.HeapDump •file.MapBytes
%DEF var V•internal.Variation LV•internal.ListVariations
%DEF tvar %USE var _tvar {F _𝕣 x: {F 𝕩 V x}¨ LV 𝕩; w F _𝕣 x: (•internal.ClearRefs@) (LV 𝕨) {(𝕨 V w) F 𝕩 V x} LV 𝕩}
@ -100,6 +100,7 @@ f ← •ReBQN{repl⇐"none"} ⋄ !6≡•Type F "⇐"
!"(file).Rename: Failed to rename file" % "testfile3B.bqn" •file.Rename "testfile.bqn"
•file.Exists¨ "testfile.bqn""nontestfile.bqn""testfile3.bqn""testfile3B.bqn" %% 1001
¯22•file.Createdir "testdirNested" %% "/testDir/testdirNested"
¯8•file.RealPath "testdirNested/.././" %% "/testDir"
!"(file).CreateDir: Failed to create directory" % •file.Createdir "testdirNested"
"testfile.bqn""testfile2.bqn""testfile3.bqn""testfile3B.bqn""testdirNested" •file.List "." %% 11011
"testfile.bqn""testfile2.bqn""testfile3.bqn""testfile3B.bqn""testdirNested" •file.List •file.path %% 11011
@ -109,6 +110,9 @@ f ← •ReBQN{repl⇐"none"} ⋄ !6≡•Type F "⇐"
•file.Remove "testfile3B.bqn" %% 1
"testfile.bqn""testfile2.bqn""testfile3B.bqn" •file.List "." %% 000
!"Failed to resolve ""/dev/file that doesn't exist"": No such file or directory" % •file.RealPath "/dev/file that doesn't exist"
!"Failed to resolve ""/dev/file that doesn't exist"": No such file or directory" % •Import "/dev/file that doesn't exist"
# •ParseFloat & •Repr