Re: file command bug on windows



On Apr 4, 5:22 pm, solar <solaradmin2...@xxxxxxxxx> wrote:
On Apr 4, 7:25 pm, "Gerald W. Lester" <Gerald.Les...@xxxxxxx> wrote:



solar wrote:
On Mar 30, 12:50 pm, suchenwi <richard.suchenwirth-
bauersa...@xxxxxxxxxxx> wrote:
On 29 Mrz., 20:21, solar <solaradmin2...@xxxxxxxxx> wrote:

% file type ~123
user "123" doesn't exist
% file type ~456
user "456" doesn't exist
% cd ~456
user "456" doesn't exist
This has not to do with the file command, but with Tcl's file name
resolution of ~ (as evident from the cd error). If filenames starting
with ~ are allowed in your application, you can sanitize them with
code like this:
% regsub {^~} ~456~78 ./&
./~456~78

Thanks for the solution. That will work...
But I was just wanted to know if "file", "cd", etc. should have been
written
to ignore interpreting  "~dir" as a user's home directory.

No, why would you want to do that -- each user has a valid home directory.

BTW, on most other file systems you can also put a tilde in a file name..
Just like on windows it is very very very rarely put at the beginning of a
file name (one of the common *inx editors, Emacs, puts it at the end of a
file name to indicate a backup file).

--
+------------------------------------------------------------------------+
| Gerald W. Lester                                                       |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+

Yes, I agree that every user has a valid home directory. But on
Windows the user's home
directories are not referred to with a leading tilde symbol. That
convention is used
only on Unix'es and maybe other OS's. So I was just wondering if the
relevant commands
should ignore this convention on Windows. Not that its a major problem
though, with
Suchenwi's solution.

Thanks for the reply
--

The fact that ~something is interpreted as a home directory is working
as documented and is useful in windows as well as in Unix. The fact
that your glob example is failing is logged as a bug at
http://sourceforge.net/tracker/index.php?func=detail&aid=2511011&group_id=10894&atid=110894

Mark
.



Relevant Pages

  • Re: restrict software installation
    ... Preventing users from executing stuff on their home directory and in ... Is there some similar principle in Windows? ... emphasis on 'minimize network transfers'. ... Perhaps you can control this via some scripting stuff? ...
    (Focus-Microsoft)
  • Re: file command bug on windows
    ... I agree that every user has a valid home directory. ... Windows the user's home ... directories are not referred to with a leading tilde symbol. ... should ignore this convention on Windows. ...
    (comp.lang.tcl)
  • Re: file command bug on windows
    ... I agree that every user has a valid home directory. ... Windows the user's home ... should ignore this convention on Windows. ... If tcl treats it on a specific way, ...
    (comp.lang.tcl)
  • Re: The one pronoun problem
    ... generally change it with a command line parameter. ... Every Windows application shortcut has a property for what directory it starts in. ... However, most Windows programs when displaying a file chooser dialog, will start with the user's home directory, the C:\ directory or My Computer. ...
    (comp.lang.java.programmer)
  • Re: Best Programming Practice?
    ... In general, you should follow the Application Compatibility guidelines on MSDN, Windows 2003 specifications, as well as the Windows XP logo specifications. ... Store user-created documents under a subfolder of My Documents, remember, use api to obtain path to My Documents ... There are pros/cons to storing user preferences in files, the registry, or maybe in your database backend if you are using one--consider carefully ... I understand that the home directory is often ...
    (microsoft.public.windows.terminal_services)