Fix for wordview xls2html and pptviewForum: User Feedback Topic: Fix for wordview xls2html and pptview started by: cbagger01 Posted by cbagger01 on April 18 2005,03:33
See below for some "diffs" that fix the "can't view a file with a space in the name" problem.Basically, I just added some hard quotes \' in appropriate places for wordview and added some double quotes in appropraite places for xls2html and pptview wordview.lua.diff:
xls2html.sh.diff:
pptview.sh.diff:
I tested all three and they seem to work fine for me. Please test and add to a future version of DSL if you agree. Posted by tronik on April 18 2005,04:26
I concur. I was going to suggest escaping it and using quotes but never got around to it. Army's had me this weekend.
Posted by gunnix on April 18 2005,10:28
I didn't realize ppthtml and xlshtml scripts had the same "problem". I looked into the lua script as well but didn't really get it right with only the " quotes , thx cbagger! Posted by roberts on April 18 2005,17:08
When I wrote
It is kinda like the forest and the trees. These three scripts being the trees and DSL being the forest. If I allow spaces in filenames then given that an OS should be consistent should we not also allow spaces in fileanames everywhere. Given that unix traditionally does not allow spaces in filenames and given the fact that most features have been designed not with "spaces" in mind. Would I be so inclined to review each and every feature of the OS from Klaus's scripts to John's perl scripts, to my bash and flua scripts to insure consistency. Really, I don't have that motivation but instead wish to presue new features and continue the development of DSL and not worry about this. I know my standards may be too high to be not practical. It would not be the first time that I have been told that. But it is something that I think about, especially when my name is associated with DSL. Something to think about. It is OK to tell me that I worry too much that this should be an exception. I just don't want to hear next that the myDSL is broken because it doesn't allow spaces in filenames too, or some other such feature is broken because of this. Something to think about. Thought you should know my thoughts on this subject. Posted by gunnix on April 18 2005,19:00
Yea, after reading your point of view, it's best to keep the support of spaces in names out of DSL Roberts. You should keep the high standards. And you won't hear me say anything about it anymore ;)But those doc files are all full of spaces! :s Heh I'll just get me a rename tool and let the spaces be replaced by _ ... why didn't I think of that earlier? grtz Posted by clivesay on April 18 2005,19:34
Roberts -I totally understand your point of view and wouldn't want you to take time to edit DSL to accomodate the spaces in the filenames. To me, in the case of these three scripts it's a necessary evil. You wouldn't even need these scripts if you weren't receiving a file from someone using M$ Office (Or I guess OpenOffice or Abiword) so you will receive the files in the formats that M$ supports. My vote is that we let it slide here but any other instances require tying up the offending individual and throwing them overboard! AAARRRRR!!!!! Chris Posted by Caspar_s on April 18 2005,20:41
Heres me being my libra self... I see Roberts point and I see Clivesay's... Unix doesn't support spaces... but these are utilities that let you see stuff that isn't from 'nix. How about adding in something that says "Take out the spaces you windows n00b" or something
Posted by clivesay on April 18 2005,21:50
Posted by cbagger01 on April 18 2005,22:36
My opinion is this:Rewriting everything in the distro to accept filenames with spaces is counterproductive. However, in this situation we are dealing with a problem caused by "helpful" Microsoft tools. For example, If I create a MSWord document with the first line of the document being a title like "How to Fish" and then push the Save button, MSOffice will automatically save the file as "How to Fish.doc". This is why spaces are so prevalent in these documents. I imagine that this is also true for XLS and PPT docs but I am not sure. Since the purpose of these scripts is to view/convert Microsoft Office docuements, I think that it is reasonable for them to handle the filenames with spaces because otherwise a large percentage of the documents that are fed into the script will fail the script. To give a similar example, recently a topic was discussed about how to use emelfm / scripts to transcode an *.mp3 file into a new file with a different bitrate. Some nice ideas were proposed on how to accomplish this. One of my suggestions was to make sure that the script can handle filenames with spaces. Why? Because many audio CD to mp3 ripper programs will automatically tag the mp3 filename with the songname that is pulled down from an Internet database and these song names contain spaces in them. So I think that it is appropriate in this case, but let it not become a slippery slope for the rest of the distro. This is a linux distro, not a windows os, so we have to draw the line somewhere. FYI, if you want a chuckle, read up on some of the problems that win32 developers have. Many of their programs ALSO have problems with spaces for the very same reason but they have no choice if they wish to use it as their target platform. Posted by roberts on April 19 2005,06:05
OK. Because these three scripts are made to view/convert MS style documents, I will accept the space mods.
|