Watch, Follow, &
Connect with Us
Public Report
Report From: Kylix/RTL    [ Add a report in this area ]  
Report #:  6792   Status: Reported
~ file handling issue
Project:  Kylix Build #:  4.186
Version:    3.0 Submitted By:   Wade Christensen
Report Type:  Minor failure / Design problem Date Reported:  1/7/2004 3:47:16 PM
Severity:    Commonly encountered problem Last Updated:
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (1 Total Rating)
5.00 out of 5
Total Votes: None
Description
When using a file name starting with the ~ (to refer to the home directory) all attemts to open or check if the file exists fail, but the exception generates a message with the file name expanded out.  For example using '~/test.txt' will generate an exception with the message '/home/user/text.txt' does not exists.  Use the file as '/home/user/text.txt' directly and it works.  (See steps for a specific example).  All file functions on systems the use the ~ = home drive setup should support the use of the ~ charater.
Steps to Reproduce:
var
FileIn : TextFile;
FileINI : TIniFIle;
begin

//This doesn't work
AssignFile(FileIn, '~/test.txt');
reset(FielIn);

//This does
AssignFile(FileIn, '/home/user/test.txt');
reset(FielIn);

//This doesn't work but generates an exception with the message
//the file or directory '/home/user/test.ini' does not exist.
FileINI := TINIFile.Create('~/test.ini');

//This does
FileINI := TINIFile.Create('/home/user/test.ini');
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01