Page 1 of 2
how many people use ('s in filenames
Posted: Sun Jan 08, 2006 12:00 am
by earlz
I am making my console and well i'm wanting to kow of a good command from argument seperator and what i mean is like dos uses space such as format C:\ I am really not wanting to use space. i was thinking ('s such as format(C:\,extra option) and have spaces in arguments a perfectly orthadox practice but how many use ('s in filenames as i dont want no quote crap
i was also thinking maybe { or [
Re: how many people use ('s in filenames
Posted: Sun Jan 08, 2006 12:00 am
by Da_Maestro
a space is more intuitive to those who are an old hand at computing. Almost all command lines follow the UNIX convention of using a space to seperate parameters on the command line, but that doesn't mean that you have to
Choose whatever is intuitive for you.
Re: how many people use ('s in filenames
Posted: Sun Jan 08, 2006 12:00 am
by Legend
(, [ and { have the problem that the user might except to see }, ] or ) then ...
Re: how many people use ('s in filenames
Posted: Sun Jan 08, 2006 12:00 am
by Da_Maestro
Music lovers will hate using the parantheses...especially those from the EDM side of things.
Remix names are nearly always enclosed in parantheses.
But in any event you're gonna have to either:
1. Ban certain characters from appearing in file names or command line parameters
2. Use wildcards or quotes to enclose names that have special characters in them
3. Have an entirely different way of entering parameters into your commands, like a GUI or something (not really feasable if you want to be using scripts in the future)
Perhaps have multiple interfaces which use different characters and let the user decide (way too much work, and too many compatability issues with scripts).
Or, face it....use the conventional command line format *thumbs up* hehe
Re: how many people use ('s in filenames
Posted: Sun Jan 15, 2006 12:00 am
by Shark8
I use Parens and square-brackets for info and versioning, respectively. So it wouldn't be uncommon to see something like "LetterToWill(draft).wpd", "Shell[2].exe" and "Kernel[3].bin" living on my hard drive.
Your idea seems like a 'programming'-style command-line, which is fine... but, in my experience, white-space is always best treated as a single (and ignored) seperator/visual-formatter.
Take the makefile structure or that programming-language that uses spaces to determine the level of the line (I forget its name) for example, a nightmare. Whereas Pascal (and C/C++) simply ignore the whitespace except as a seperator.
Just my two cents, hope you find it useful.
Re: how many people use ('s in filenames
Posted: Tue Jan 17, 2006 12:00 am
by JAAman
white-space is always best treated as a single (and ignored) seperator/visual-formatter.
the problem is that whatever is used as a separater, must be forbidden in filenames -- if you use a space, then no filename may contain spaces, and most people use spaces regularly
Re: how many people use ('s in filenames
Posted: Tue Jan 17, 2006 12:00 am
by Hery
I don't think that we often use filenames with space... I always use _ instead of space. However it will be good to allow filenames with space, but for example file name must be into "s or ('s, for example:
Code: Select all
cd "Program Files"
cd (Program Files)
Everything what you need is a good algorithm.
Re: how many people use ('s in filenames
Posted: Tue Jan 17, 2006 12:00 am
by carbonBased
the problem is that whatever is used as a separater, must be forbidden in filenames -- if you use a space, then no filename may contain spaces, and most people use spaces regularly
Unless, ofcourse, you use a form of escape codes... at which point you can use any character in the filename.
Re: how many people use ('s in filenames
Posted: Tue Jan 17, 2006 12:00 am
by carbonBased
Hery Sasta wrote:I don't think that we often use filenames with space... I always use _ instead of space. However it will be good to allow filenames with space, but for example file name must be into "s or ('s, for example:
Code: Select all
cd "Program Files"
cd (Program Files)
Everything what you need is a good algorithm.
Most users that don't remember DOS will use spaces in filenames. Old school developers dont use them out of habit (they recall when it wasn't legal) and because it's a pain to use spaces in a terminal window... but, of course, we aren't the majority of OS users
Re: how many people use ('s in filenames
Posted: Tue Jan 17, 2006 12:00 am
by Da_Maestro
JAAman wrote:
the problem is that whatever is used as a separater, must be forbidden in filenames -- if you use a space, then no filename may contain spaces, and most people use spaces regularly
Not nessesarily. *NIX and Windows allow the use of spaces, and they achieve this by putting quote marks around filenames wich contain spaces.
Re: how many people use ('s in filenames
Posted: Wed Jan 18, 2006 12:00 am
by JAAman
yes, but they then cannot allow quotes within filenames
i don't think anyone understood what i meant -- you have to use something as a separater, but whatever you choose cannot be allowed in the filename
DOS uses spaces (and will not permit them in filenames -- and i cannot remember the last longer filename i created without spaces)
win9x/winXP do permit spaces (even at the command line) but they use quotes for separaters (with the special exception of allowing spaces if it doesn't begin with a quote -- for compatability))
Re: how many people use ('s in filenames
Posted: Wed Jan 18, 2006 12:00 am
by Da_Maestro
*NIX allows any character in a file name. *NIX shells use the backslash ('\') in the command line to denote that the next character is literal. The backslash is used to remove the special meaning from all of *NIXs special characters.
The only reason Microsoft included these special rules for allowable characters in file names for that one reason, being backward compatability.
With a new operating system, this is not an issue. Really any developer should experiment with the command line formats and go with whatever suits them.
Re: how many people use ('s in filenames
Posted: Thu Jan 19, 2006 12:00 am
by carbonBased
JAAman wrote:yes, but they then cannot allow quotes within filenames
They could, though:
do_something "filename with spaces and "quotes"" etc last argument
And before someone says you can't use \ in a filename, you'd just prefix it again:
do_something "filename with spaces and "quotes" and \\ slashes"
--Jeff
Re: how many people use ('s in filenames
Posted: Thu Jan 19, 2006 12:00 am
by Da_Maestro
In *NIX you can even put unreadable characters in filenames, characters such as carriage returns and bells. Makes it really confusing when the names in your drive get corrupted
Re: how many people use ('s in filenames
Posted: Fri Jan 20, 2006 12:00 am
by Shark8
Da_Maestro wrote:In *NIX you can even put unreadable characters in filenames, characters such as carriage returns and bells. Makes it really confusing when the names in your drive get corrupted
LOL - Indeed, it would be wise not to allow unreadible characters in the filename. Well, in my oppinion.