Эффект проявился в Linux/wine где допустимы пути "/x/y/../z". Если в windows это не допустимо, то ошибки нет.
Файл должен появляться в той локации, где был создан New:
Цитата:
PROCEDURE (f: File) Register (name: Name; type: Type; ask: BOOLEAN; OUT res: INTEGER)
...
PROCEDURE (d: Directory) New (loc: Locator; ask: BOOLEAN): File
NEW, ABSTRACT
Returns a new file object (or NIL if this is not possible). This file is anonymous, i.e., not yet registered in the directory. (In host file systems where anonymous files are not directly supported, they may appear under temporary names in subdirectory loc.) If the file is registered later, it will appear in the subdirectory specified by loc.
Т.к. Register не проверят, что в name только имя, --- относит. путь + имя нивелирует "it will appear in the subdirectory specified by loc".
Код:
PROCEDURE (f: File) Register (name: Files.Name; type: Files.Type; ask: BOOLEAN; OUT res: INTEGER);
VAR b: INTEGER; fname: FullName;
BEGIN
ASSERT(f.state = new, 20); ASSERT(name # "", 21);
Append(f.loc.path, name, type, f.loc.maxLen, fname);
CheckDelete(fname, f.loc.path, ask, res);
ASSERT(res # 87, 100);