Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 1044 → Rev 1045

/svarcom/trunk/cmd/truename.c
0,0 → 1,58
/* This file is part of the SvarCOM project and is published under the terms
* of the MIT license.
*
* Copyright (C) 2021-2022 Mateusz Viste
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
 
/*
* truename [path]
*/
 
static enum cmd_result cmd_truename(struct cmd_funcparam *p) {
unsigned short res;
 
if (cmd_ishlp(p)) {
nls_outputnl(39,0);
outputnl("");
nls_outputnl(39,1);
return(CMD_OK);
}
 
if (p->argc > 1) {
nls_outputnl(0,4); /* too many parameters */
return(CMD_FAIL);
}
 
if (p->argc == 0) {
res = file_truename(".", p->BUFFER);
} else {
res = file_truename(p->argv[0], p->BUFFER);
}
 
if (res != 0) {
nls_outputnl_doserr(res);
return(CMD_FAIL);
}
 
outputnl(p->BUFFER);
 
return(CMD_OK);
}
/svarcom/trunk/cmd.c
97,6 → 97,7
#include "cmd/set.c"
#include "cmd/shift.c"
#include "cmd/time.c"
#include "cmd/truename.c"
#include "cmd/type.c"
#include "cmd/ver.c"
#include "cmd/verify.c"
141,6 → 142,7
{"SET", cmd_set},
{"SHIFT", cmd_shift},
{"TIME", cmd_time},
{"TRUENAME",cmd_truename},
{"TYPE", cmd_type},
{"VER", cmd_ver},
{"VERIFY", cmd_verify},
/svarcom/trunk/history.txt
6,6 → 6,7
=== ver 2022.3 (xx.xx.xxxx) ==================================================
 
- fixed stdin redirection handling (was broken since 2022.1)
- implemented the TRUENAME command
- ln creates %DOSDIR%\LINKS directory when needed and warns on error
- added German translations, courtesy of Robert Riebisch (bttr)
- added French translations, kindly contributed by Berki Yenigün (thraex)
/svarcom/trunk/lang/en-utf8.txt
244,6 → 244,10
38.8:NOTE: /A and /B are no-ops (ignored), provided only for compatibility reasons.\r\nCOPY assumes binary always.
38.9:%u file(s) copied
 
# TRUENAME
39.0:Returns a fully qualified path or filename.
39.1:TRUENAME [drive:][path]filename
 
# DOS ERRORS
255.1:Function number invalid
255.2:File not found
/svarcom/trunk/svarcom.txt
50,6 → 50,7
SET - displays, sets or removes DOS environment variables
SHIFT - changes the position of arguments in a batch file
TIME - displays or sets the system time
TRUENAME - returns a fully qualified path or filename
TYPE - displays the contents of a text file
VER - displays the DOS version
VERIFY - tells DOS whether to verify that files are written correctly