PCLinuxOS-Forums
News: ...FLASH!!! ...New PCLinuxOS Testing board now open. Register today! Be an active contributor to the PCLinuxOS future! ... Read all about it now, on THIS forum!!!..
 
*
Welcome, Guest. Please login or register. May 25, 2012, 08:18:47 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: [ solved ] Opera having a problem with question mark in title when saving  (Read 316 times)
wedgetail
PCLinuxOS Tester
Hero Member
*******
Online Online

Posts: 2111


Any Bugs in site?


« on: January 28, 2012, 09:24:02 PM »

I am having a bit of a hard time fighting off all the friendly 'tests' my main pc2 is presenting me with in a steady stream.  I had just had a problem with my Opera Icon deciding to embark on adventure and disappear off the sub Menu > Internet. Bit of a battle to get it back again, seemed it liked being a widget on my Desktop presently running as "Desktop option". This all started because I wanted Opera to open a new window in the current Desktop. Up to now I had been stuck with a new Opera instance always opening in a new tab. I think I have got Opera to do exactly what I prefer.

I give this as background because it clouded my view on the next problem for a while.

The story:
I was trying to update my copies of important to me forum threads. Going through a directory with many files saved from Opera in the .html format where the topic name often is long. This causes you not seeing the full filename most of the time.  I had gone through a lot of files opening/closing just checking.

Then I met a copy that would not budge (one of my own topics on Forum even), Opera declared ERROR. The file opened fine in Firefox and Konqueror.

Took some time before I realised I have met the problem before and forgotten. If the filename ends with ?.html then Opera will not play.   Grin

I assume that some rule has been broken.  
Logged

KDE & KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen
djohnston
PCLinuxOS Tester
Hero Member
*******
Offline Offline

Posts: 5695


I don't do Windows


« Reply #1 on: January 28, 2012, 09:40:41 PM »

Not sure why only Opera has a problem with that. Maybe following conventions too closely.
? is a single character wildcard for both Linux and MSDOS. For example, with these files in a directory:

fileab.txt
file12.txt
file-.txt
pic9.jpg
picz.jpg
pic().jpg

Issuing the DOS command: dir file??.txt

would show fileab.txt and file12.txt.

Issuing the Linux command: ls pic?.jpg

would show pic9.jpg and picz.jpg.
Logged

Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378
YouCanToo
PCLinuxOS Tester
Hero Member
*******
Offline Offline

Posts: 4244


Location: Lebanon, OR., USA


WWW
« Reply #2 on: January 28, 2012, 10:27:19 PM »

Not sure why only Opera has a problem with that. Maybe following conventions too closely.
? is a single character wildcard for both Linux and MSDOS. For example, with these files in a directory:

fileab.txt
file12.txt
file-.txt
pic9.jpg
picz.jpg
pic().jpg

Issuing the DOS command: dir file??.txt

would show fileab.txt and file12.txt.

Issuing the Linux command: ls pic?.jpg

would show pic987.jpg and piczyx.jpg.


This may be true when dealing with the command line, but he is dealing with a .html file. Since when is a "?" a valid character in a file name in a .html file

Legal characters for file names include the following:

    Upper case letters A–Z
    Numbers 0–9
    Space at the start of a file name.
    ! # $ % & ' ( ) - @ ^ _ ` { } ~
    Values 128–255

This excludes the following ASCII characters:

    " * / : < > ? \ |

So Opera is doing what it should be doing. So who is breaking the rules by putting a "?" in a file name Huh
Logged





Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!
wedgetail
PCLinuxOS Tester
Hero Member
*******
Online Online

Posts: 2111


Any Bugs in site?


« Reply #3 on: January 29, 2012, 12:03:26 AM »

 Embarrassed  For starters I broke the rule, I should have checked for valid file names. I did not remember more than the space is not a good choice in a filename. Though I am sure I have quite a few.

I saved the file in question with name:

Quote
100816-Print Page-Repeating configuration of Kate or Kwrite, how?.htm

Just when I did a copy/paste to forum of the filename from Konqueror I got another surprise:

Quote
100816-Print Page-Repeating configuration of Kate or Kwrite, how%3F.htm

Starting to look like that a filename "cleaner" or validation checker could be handy.  I won't even bet that old-polack has already spotted this years ago. I seem to remember he had a script to sort out the spaces in filenames. Since I am now saving files with spaces that would be handy.

So Konqueror and Firefox can deal with the problem but not Opera.  To start with best not having question mark in the subject topic if I start a thread. (Because I will be saving the topic and Opera is my favorite still)

Logged

KDE & KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen
djohnston
PCLinuxOS Tester
Hero Member
*******
Offline Offline

Posts: 5695


I don't do Windows


« Reply #4 on: January 29, 2012, 01:47:30 AM »

Yes, what YouCanToo said about reserved filename characters. I had to edit my post because of the ls results. I had originally started out with three wildcard characters in the filename. Then when I reviewed my post, I discovered that "ls pic (three question marks in bold).jpg" = ls picHuh.jpg. And, I forgot to narrow the results down to one wildcard character rather than three.

Anyway, I agree. A ? is a reserved filename character, reserved for wildcard searches.
Logged

Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378
GoustiFruit
Sr. Member
****
Offline Offline

Posts: 428


« Reply #5 on: January 29, 2012, 03:45:19 AM »

How did you save a file with a "?" in his name in the first time Huh The OS should have prevented you from doing so !?
Logged
wedgetail
PCLinuxOS Tester
Hero Member
*******
Online Online

Posts: 2111


Any Bugs in site?


« Reply #6 on: January 29, 2012, 05:46:33 AM »

GoustiFruit

It was saved from Opera, I found the topic again today and saved it, thinking I had a corrupt file. Again Opera would not open it, until I removed the "?" mark.

I thought it was interesting that copy/paste to kwrite (and Forum post) the pasted line has %3F representing the "?" the ? = 3F  in hexadecimal

The understanding need a deeper knowledge of Oper's rules, I don't have that.    Grin
Logged

KDE & KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen
YouCanToo
PCLinuxOS Tester
Hero Member
*******
Offline Offline

Posts: 4244


Location: Lebanon, OR., USA


WWW
« Reply #7 on: January 29, 2012, 02:55:18 PM »

Yes, what YouCanToo said about reserved filename characters. I had to edit my post because of the ls results. I had originally started out with three wildcard characters in the filename. Then when I reviewed my post, I discovered that "ls pic (three question marks in bold).jpg = ls picHuh.jpg. And, I forgot to narrow the results down to one wildcard character rather than three.

Anyway, I agree. A ? is a reserved filename character, reserved for wildcard searches.



Also the '?' is a delimiter when passing arguments via html  IE:

Code:

http://recipes.dm-enterprises.net/?p=recipe&recipe=346


the above code passes the arguments to the script telling it which recipe in the database that is to be displayed.  Everything to the right of the '?' is the argument.  You can even see this happening right here on the forum when looking at the URL line of the browser. In the case of this page you would see something like this

Code:
http://www.pclinuxos.com/forum/index.php?action=post;quote=869713;topic=102086.0;num_replies=6;sesc=8f2962ad242572171ab5bf7a6fb043e6

In html the '?' is ampersand pound 63 semi-colon

Code:
&#63;
Logged





Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!
Old-Polack
Administrator
Hero Member
*****
Offline Offline

Posts: 9693


----IOFLU----


« Reply #8 on: January 29, 2012, 03:52:52 PM »


Starting to look like that a filename "cleaner" or validation checker could be handy.  I won't even bet that old-polack has already spotted this years ago. I seem to remember he had a script to sort out the spaces in filenames. Since I am now saving files with spaces that would be handy.


Actually have a few; all being variations on the same basic script. The first replaces the space with an underscore;

---------------------------------------------- start ---------------------------------------------------
#!/bin/sh
# Author=old-polack
# Name=unspace
# Purpose=To replace spaces in file names with "_"

for i in *.*; do mv "$i" `echo $i | tr ' ' '_'`; done


-----------------------------------------------  end ---------------------------------------------------

This is basically the same script, but replaces the space with a dash;

------------------------------------------------ start --------------------------------------------------
#!/bin/sh
# Author=old-polack
# Name=unspace1
# Purpose=To replace spaces in file names with "-"

for i in *.*; do mv "$i" `echo $i | tr ' ' '-'`; done


------------------------------------------------- end --------------------------------------------------

This one replaces spaces with an underscore in directory names as well as file names;

------------------------------------------------ start --------------------------------------------------
#!/bin/sh
# Author=old-polack
# Name=unspaceall
# Purpose=To replace spaces in both directory, and file names with "_"

for i in *; do mv "$i" `echo $i | tr ' ' '_'`; done


------------------------------------------------- end --------------------------------------------------

This one replaces the spaces in directory names and file names in the current directory and whatever sub directories it contains;

------------------------------------------------ start --------------------------------------------------
#!/bin/bash
# Author=old-polack
# Name=deepspace
# Purpose=run unspaceall,
# then cd into each sub directory,
# run unspaceall, then return to the present directory.

unspaceall;

for i in */; do cd "$i" && unspaceall && cd ../; done


------------------------------------------------- end --------------------------------------------------

If one has deeply nested sub directories, burrow down to the next layer that still has spaces present and run the script again.  Save each script, using the name shown in each, in /home/<user>/bin which by default is already in your <user> $PATH, then make each executable by right clicking each and choosing Properties --> Permissions and then checking the Is executable box.

Note: unspaceall replaces spaces with underscores, but can be edited to use dashes if desired, as shown with unspace1.
Logged

Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...
wedgetail
PCLinuxOS Tester
Hero Member
*******
Online Online

Posts: 2111


Any Bugs in site?


« Reply #9 on: January 29, 2012, 05:07:17 PM »

Old-Polack

Thank you.  I just saved this topic and will go back and change the "?" to verbose question mark, to make sure I can open it. Not going to have trouble with looking at your little files. 

It is raining steadily here now so I will have a look at the scripts and try them out immediately.   Grin
Logged

KDE & KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen
wedgetail
PCLinuxOS Tester
Hero Member
*******
Online Online

Posts: 2111


Any Bugs in site?


« Reply #10 on: January 29, 2012, 09:35:55 PM »

Old-Polack

Ah, your post threw me a challenge, looking for /home/gert/bin I thought perhaps you meant  /usr/bin

Then echoed $PATH and found that I do have /home/gert/bin here

Quote

[gert@localhost:~] $mkdir ./bin
[gert@localhost:~] $ls -l
total 728208
-rw-rw-r--  1 gert gert       438 Jan 27 13:00 010112-startx_attempt.glk
-rw-rw-r--  1 gert gert     15163 Jan  2 17:10 110919-Copy_Energy_Watertanks.ods
-rw-rw-r--  1 gert gert     71764 Sep 30 21:16 110930-LO_Printing_of_Typhoon_Document.pdf
drwxr-xr-x  2 gert gert      4096 Jan 30 13:11 bin
drwxr--r--  2 gert gert      4096 Jan 30 13:03 Desktop
drwx------  7 gert gert      4096 Jan 30 10:46 Documents
drwx------  2 gert gert      4096 Jan 27 12:19 downloads


[root@localhost gert]# ls -l ./bin
total 20
-rw-r--r-- 1 gert gert   2 Jan 30 12:36 120130-Old-Polack_bash_scripts.glk
-rwxr-xr-x 1 gert gert 233 Jan 30 12:28 deepspace*
-rwxr-xr-x 1 gert gert 151 Jan 30 12:26 unspace*
-rwxr-xr-x 1 gert gert 151 Jan 30 12:27 unspace1*
-rwxr-xr-x 1 gert gert 171 Jan 30 12:28 unspaceall*
[root@localhost gert]#

As you can see I have made the directory, not sure if this is the traditional way using ./--- and I was able to make a directory as user?

Quote
[gert@localhost:~] $mkdir /heres
mkdir: cannot create directory `/heres': Permission denied  < ----- as I expected because of user space
[gert@localhost:~] $


Quote

[gert@localhost:~] $mkdir ./heres
[gert@localhost:~] $rmdir ./heres
[gert@localhost:~] $


What have I got myself into now   Grin

Should have mentioned the first script tried and worked in test directory.
Logged

KDE & KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen
Old-Polack
Administrator
Hero Member
*****
Offline Offline

Posts: 9693


----IOFLU----


« Reply #11 on: January 29, 2012, 11:22:29 PM »

wedgetail:

If you are already in your ~ all you need is mkdir bin or mkdir here. Without any / or ./ the mkdir command makes the directory in the PWD.
Logged

Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...
wedgetail
PCLinuxOS Tester
Hero Member
*******
Online Online

Posts: 2111


Any Bugs in site?


« Reply #12 on: January 30, 2012, 12:12:02 AM »

Old-Polack

Oh, I should remember that outside /home/<user>  the <user> is restricted to what can be written/changed but can read a lot.  Thanks for clearing that up.  Smiley
Logged

KDE & KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM