flat assembler
Message board for the users of flat assembler.

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

Joined: 20 Feb 2006
Posts: 4272
Location: Now
edfed
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
28 Feb 2014, 10:04
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 18837
revolution
Using quotes around the %1 parameter works for me.
28 Feb 2014, 10:21
edfed

Joined: 20 Feb 2006
Posts: 4272
Location: Now
edfed
using quotes around the %1 parameter cannot work when using directlly the fasmw editor as default editor application, and is a workaround....
28 Feb 2014, 10:28
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 18837
revolution
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.
28 Feb 2014, 10:32
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 18837
revolution
Actually it is not a "workaround", it is a requirement since there is no other way to distinguish a single parameter from multiple parameters.
28 Feb 2014, 10:33
edfed

Joined: 20 Feb 2006
Posts: 4272
Location: Now
edfed
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 )
28 Feb 2014, 10:48
sid123

Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123
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.
28 Feb 2014, 11:00
edfed

Joined: 20 Feb 2006
Posts: 4272
Location: Now
edfed
it supports them at run time, but not at startup...
28 Feb 2014, 11:03
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 18837
revolution
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.
28 Feb 2014, 11:08
l_inc

Joined: 23 Oct 2009
Posts: 881
l_inc
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
28 Feb 2014, 11:16
edfed

Joined: 20 Feb 2006
Posts: 4272
Location: Now
edfed
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
28 Feb 2014, 11:24
l_inc

Joined: 23 Oct 2009
Posts: 881
l_inc
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
28 Feb 2014, 12:52
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 18837
revolution
l_inc wrote:
Actually I'm not sure, what exactly revolution means with a bug.
To support multiple files use "%*" instead of "%1"
28 Feb 2014, 13:15
l_inc

Joined: 23 Oct 2009
Posts: 881
l_inc
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
28 Feb 2014, 13:49
Tomasz Grysztar

Joined: 16 Jun 2003
Posts: 8026
Location: Kraków, Poland
Tomasz Grysztar
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.
28 Feb 2014, 14:32
l_inc

Joined: 23 Oct 2009
Posts: 881
l_inc
Tomasz Grysztar
Some statements are made to just obtain a quick disproof.

_________________
Faith is a superposition of knowledge and fallacy
28 Feb 2014, 16:24
baldr

Joined: 19 Mar 2008
Posts: 1651
baldr
Tomasz Grysztar wrote:
There is an undocumented setting in .ini file that does that.
Though it's pretty well documented in the fasm source.
28 Feb 2014, 21:18
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainTutorials and ExamplesDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsOS ConstructionIDE DevelopmentProjects and IdeasNon-x86 architecturesHigh Level LanguagesProgramming Language DesignCompiler Internals Other----------------FeedbackHeapTest Area

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum