flat assembler
Message board for the users of flat assembler.

Index > Windows > [BUG or FEATURE?] old request, spaces in file path

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 28 Feb 2014, 10:04
in order to use fasmw as an alternative to notepad, notepad++ and all theses bloated text editors, the only missing thing (sing sing) is to be able to open a file when it's path contains spaces in it.

the workaround that consist in creating a shortcut with %1 to state arg1 as a full path is not viable cause it will never be taken in account when fasmw is used in place of notepad (rename fasmw.exe as notepad.exe and replace notepad in the system folders), the only way to give fasmw the opportunity to become a default text editor is to be able to do that.

thanks
Post 28 Feb 2014, 10:04
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 28 Feb 2014, 10:21
Using quotes around the %1 parameter works for me.
Post 28 Feb 2014, 10:21
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 28 Feb 2014, 10:28
using quotes around the %1 parameter cannot work when using directlly the fasmw editor as default editor application, and is a workaround....
Post 28 Feb 2014, 10:28
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 28 Feb 2014, 10:32
edfed wrote:
using quotes around the %1 parameter cannot work when using directlly the fasmw editor as default editor application, ...
Why? It works for me in WinXP and Win7. What version of Windows are you using? Although it has been supported since at least Win95 IIRC.
Post 28 Feb 2014, 10:32
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 28 Feb 2014, 10:33
Actually it is not a "workaround", it is a requirement since there is no other way to distinguish a single parameter from multiple parameters.
Post 28 Feb 2014, 10:33
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 28 Feb 2014, 10:48
does fasmW need multiple parameters? isn't it just a simple text editor able to open a single file at one. if you try to select multiple files, and rightclic to open them using fasmw, it will open one fasmw per file, then, there is no multiple parameters for the text editor.

it is the same ergonomic problem with every windows versions i tested (from 98 to 8 )
Post 28 Feb 2014, 10:48
View user's profile Send private message Visit poster's website Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 28 Feb 2014, 11:00
If you don't want to use bloated text editors EDIT.COM is the best for you </sarcasm>
IlRC that FASMW supports multiple text files at once, there are tabs at the bottom to switch between
them.
Post 28 Feb 2014, 11:00
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 28 Feb 2014, 11:03
it supports them at run time, but not at startup...
Post 28 Feb 2014, 11:03
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 28 Feb 2014, 11:08
edfed wrote:
does fasmW need multiple parameters? isn't it just a simple text editor able to open a single file at one. if you try to select multiple files, and rightclic to open them using fasmw, it will open one fasmw per file, then, there is no multiple parameters for the text editor.
Specifying more than one parameter to fasmw will open all files in a separate tab in a single process at startup. Well it does for me anyway, so that is why quotes are needed to properly delineate each file if there are spaces in the paths.
edfed wrote:
it is the same ergonomic problem with every windows versions i tested (from 98 to 8 )
I think you have a bug in the ".asm" definition in your registry.
Post 28 Feb 2014, 11:08
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc 28 Feb 2014, 11:16
edfed
Quote:
it supports them at run time, but not at startup...

Firstly, as revolution said, fasmw supports multidocument work both at startup and at runtime.
Secondly, it does not matter how many arguments an application supports. Spaces must always be enclosed in quotes unless they separate different arguments. It is defined like that. The rationale behind this is that an application always gets at least one argument, which is in a standard case the path to it's executable. Even if an application needs to process only a single additional argument, it still needs to be able to separate it's own path with possible spaces from the following argument.

_________________
Faith is a superposition of knowledge and fallacy
Post 28 Feb 2014, 11:16
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4330
Location: Now
edfed 28 Feb 2014, 11:24
ok, get it, i will try to set it in registry... maybe a .reg file to setup the file types in windows can be cool in order to let "programming only coders" work without carrying about the boring particularity of the os Smile
Post 28 Feb 2014, 11:24
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc 28 Feb 2014, 12:52
edfed
Quote:
maybe a .reg file to setup the file types in windows can be cool

It depends a lot on things like OS version (e.g., 32 bit vs. 64 bit) and on some other specifics, because different keys do quite similar stuff. Like you could just replace the default notepad for extensions defined as txtfile. Or you could define an extra type like asmfile or if you already have some other type for the .asm-extension then you just override the existing settings of that type. Therefore some logic beyond the reg-file capabilities is needed to correctly achieve the desired result.

Actually I'm not sure, what exactly revolution means with a bug. To make an example. Here's how it could look like:
Code:
HKEY_CLASSES_ROOT
+ asmfile
  + (Default):REG_SZ = "Assembler Source" ;this one is just a description shown by the "Set associations" utility
  + shell
    + open
      + command
        + Default:REG_EXPAND_SZ = "\"%SystemDrive%\\fasm\\fasmw.exe\" \"%1\"" ;the quotes around %1 are actually not necessary here, but you could try it out
+ .asm
  + (Default):REG_SZ = "asmfile" ;points to the above key
  + Content Type:REG_SZ = "text/plain" ;not necessary
  + PerceivedType:REG_SZ = "text" ;also not necessary. Points to the HKEY_CLASSES_ROOT\SystemFileAssociations\text with additional definitions like the "edit" verb    

These settings however could be overridden by the key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.asm. Then those won't have any effect and you should adjust smth. like the Progid value in the UserChoice subkey.

_________________
Faith is a superposition of knowledge and fallacy
Post 28 Feb 2014, 12:52
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 28 Feb 2014, 13:15
l_inc wrote:
Actually I'm not sure, what exactly revolution means with a bug.
To support multiple files use "%*" instead of "%1"
Post 28 Feb 2014, 13:15
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc 28 Feb 2014, 13:49
revolution
You are right... half right. I just checked before posting and it somehow worked without quotes and the asterisk. But now I've checked the command line arguments and it was just because explorer started multiple instances (one per selected file) with a singleton Notepad++. The problem is however that "%*" always expands into an empty string. Therefore I'm out of simple suggestions, cause I don't think fasmw is able to prevent multiple instances.

_________________
Faith is a superposition of knowledge and fallacy
Post 28 Feb 2014, 13:49
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 28 Feb 2014, 14:32
l_inc wrote:
Therefore I'm out of simple suggestions, cause I don't think fasmw is able to prevent multiple instances.
There is an undocumented setting in .ini file that does that.
Post 28 Feb 2014, 14:32
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc 28 Feb 2014, 16:24
Tomasz Grysztar
Some statements are made to just obtain a quick disproof.

_________________
Faith is a superposition of knowledge and fallacy
Post 28 Feb 2014, 16:24
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 28 Feb 2014, 21:18
Tomasz Grysztar wrote:
There is an undocumented setting in .ini file that does that.
Though it's pretty well documented in the fasm source. Wink
Post 28 Feb 2014, 21:18
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.