FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 06-01-2011, 08:10 PM
Ian Malone
 
Default tmpfiles.d and spaces in filenames

On 1 June 2011 19:27, Corinna Vinschen <vinschen@redhat.com> wrote:
> On Jun *1 09:59, JD wrote:
>> On 06/01/11 09:37, Ian Malone wrote:
>> > On 1 June 2011 16:11, Corinna Vinschen<vinschen@redhat.com> *wrote:
>> >> Hi,
>> >>
>> >> How can I specify filenames with spaces in tmpfiles.d configuration
>> >> files? *There's no hint in `man tmfiles.d'. *I tried
>> >>
>> >> - fstab style: * * *d /foo40bar 0755 root root
>> >> [...]
>> >> So, do I have to take it that tmpfiles.d doesn't grok spaces in
>> >> filenames at all?
>> >>
>> >> Please note, I'm not asking for the obvious answer "don't do this" and
>> >> I'm also not asking for the counter question "why do you need this?"
>> >>
>> > [...]
>> > So the long answer is you either have to modify tmpfiles.c to deal
>> > with this or write a similar daemon to do it.
>
> I guess this should be converted into a bugzilla entry then.
>

> That's not always possible and you can't ask all users to rename their
> files. *Filenames like "Expenses May 2011.odt" are just to be expected.
> Another example is the default naming of CF or SD media formatted on
> certain camera models. *Yet another exmaple are customer request.
>

So far as I understand from the manpage, tmpfiles.d is not so much for
cleaning the tmp directory on a regular basis as for creating and
managing temporary files and directories on volatile filesystems. I'm
not sure there's really a compelling argument for having this as a
request for feature, except if you must have spaces in the temporary
directory name for some reason. Being able to use anything you can put
in fstab (consistency argument) is probably the only one that flies.
If you have customers that run unix, care exactly what temporary
system locations you use and insist there are spaces in the names then
you have very weird customers.

--
imalone
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 06-01-2011, 08:18 PM
Ian Malone
 
Default tmpfiles.d and spaces in filenames

On 1 June 2011 20:30, Mike Williams <dmikewilliams@gmail.com> wrote:
>
>
> On Wed, Jun 1, 2011 at 3:18 PM, JD <jd1008@gmail.com> wrote:
>>
>> On 06/01/11 12:05, Patrick O'Callaghan wrote:

>> > No, each filename counts as one argument, even if it has spaces in it.
>> > The problem arises when you *use* the argument. The above should read:
>> >
>> > for i in *; do
>> > [ -f "$i"]&& *echo "$i" is a file
>> > done

>> > (the quotes are optional in the echo case obviously).

>> The quotes are not optional.
>
>
> I think he meant that the quotes are optional for the echo $i - which is
> correct.
>

Not entirely:
$ echo a b
a b

> Personally I avoid spaces in filenames and usually use a perl one liner
> to substitute an underscore for spaces when I don't have to keep the
> original name for someone else.

Yes, in general hours of pain here, especially if you work with people
who do lots of shell scripting and another group of people who use
Windows lots.

> zsh works without any quotes, the first example works fine for files with spaces in the names with zsh.

Might have to look into that, I keep meaning to check out zsh properly.

--
imalone
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 06-01-2011, 08:39 PM
JD
 
Default tmpfiles.d and spaces in filenames

On 06/01/11 12:30, Mike Williams wrote:
>
>
> On Wed, Jun 1, 2011 at 3:18 PM, JD <jd1008@gmail.com
> <mailto:jd1008@gmail.com>> wrote:
>
> On 06/01/11 12:05, Patrick O'Callaghan wrote:
> > On Wed, 2011-06-01 at 09:59 -0700, JD wrote:
> >> Since a space is Unix's and Linux's chosen field separator,
> >> I think having a space in filenames should be avoided. there
> >> are many situations where spaces in filenames cause problems.
> >> A simple example:
> >>
> >> for i in *; do
> >> [ -f $i ]&& echo $i is a file
> >> done
> >>
> >> you will see that the file with spaces in it's name
> >> will not be recognized as a file because each
> >> space-separated member of that file name
> >> becomes a separate argument
> >> when * is expanded by the shell.
> >
> > No, each filename counts as one argument, even if it has spaces
> in it.
> > The problem arises when you *use* the argument. The above should
> read:
> >
> > for i in *; do
> > [ -f "$i"]&& echo "$i" is a file
> > done
> >
> > (the quotes are optional in the echo case obviously).
> >
> > poc
> >
> The quotes are not optional.
>
> I think he meant that the quotes are optional for the echo $i - which
> is correct.
>
> Personally I avoid spaces in filenames and usually use a perl one
> liner to substitute an underscore for spaces when I don't have to keep
> the original name for someone else.
>
> zsh works without any quotes, the first example works fine for files
> with spaces in the names with zsh.
>
> Mike
>
Nop!
They are not optional for the "use" of the value of the variable, as
I clearly demonstrated above.

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 06-01-2011, 08:48 PM
JD
 
Default tmpfiles.d and spaces in filenames

On 06/01/11 12:39, Patrick O'Callaghan wrote:
> On Wed, 2011-06-01 at 12:18 -0700, JD wrote:
>> The quotes are not optional.
> Read my message again.
>
> poc
>
Did you read my samples of "use" ?
Did you see the difference when the quotes
were used and when the quotes were not?


--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 06-01-2011, 09:15 PM
Patrick O'Callaghan
 
Default tmpfiles.d and spaces in filenames

On Wed, 2011-06-01 at 13:48 -0700, JD wrote:
> On 06/01/11 12:39, Patrick O'Callaghan wrote:
> > On Wed, 2011-06-01 at 12:18 -0700, JD wrote:
> >> The quotes are not optional.
> > Read my message again.
> >
> > poc
> >
> Did you read my samples of "use" ?
> Did you see the difference when the quotes
> were used and when the quotes were not?

Of course I did. You're simply repeating what I said and you seem not to
have read carefully. Once again: the quotes are necessary in the use of
the variable.

I also mentioned that in the specific application of "echo" as used in
your example it didn't make much difference, though as Ian Malone has
pointed out there is the case of multiple spaces in the name being
collapsed to one. That's technically correct but it's a distinction
without a difference for the example input you give*. I'm sorry I even
brought it up if it's causing so much confusion.

poc

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 07:53 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org