Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Create new file with passed filename like notepad #210

Open
pnp0a03 opened this issue Sep 29, 2019 · 3 comments
Open

[Feature request] Create new file with passed filename like notepad #210

pnp0a03 opened this issue Sep 29, 2019 · 3 comments

Comments

@pnp0a03
Copy link
Contributor

pnp0a03 commented Sep 29, 2019

Describe the solution you'd like
If you launch Notepad.exe from cmdline (or Win+R, etc) with filename that not exist yet, Notepad.exe shows the dialog "File does not exist. Do you want to create it?"
Is it possible that adding this feature to Notepads.exe?

image

Describe alternatives you've considered

image

@0x7c13
Copy link
Owner

0x7c13 commented Sep 29, 2019

Well, this is tricky. It is absolutely doable. But I need to do a lot of things to make sure it is working as intended, for example:

  1. File name validation (check invalid characters)
  2. Path validation (make sure we have access to the folder) if we want to create the file for the user. Even with that, a picker will open still since UWP app does not have permission to create an arbitrary file in an arbitrary location,
  3. What if the user is intended to open a specific file but:
    • Typo in the command?
    • Wrong path?
      In this case, we should just ignore or let user know file is not found instead of creating the file.

So the conclusion is to not do it for now for creating a new file.

@ghost
Copy link

ghost commented Nov 1, 2019

1. File name validation (check invalid characters)

is this the only thing that will enable opening files that already exist. just for a minimal solution that is not equivalent to notepad.

this will enable opening files that notepads doesn't open but notepad can from powershell 5.1 or powershell 6.2 session.

2. Path validation (make sure we have access to the folder) if we want to create the file for the user. Even with that, a picker will open still since UWP app does not have permission to create an arbitrary file in an arbitrary location,

and add controlled folder access to that. for a standard users account. more complex things to do for a app.

3. What if the user is intended to open a specific file but: ...

seems far-off in the future and when app is in really mature stage. i'd say low priority for me.


regards ratatoeey

@soumyamahunt
Copy link
Contributor

Describe the solution you'd like
If you launch Notepad.exe from cmdline (or Win+R, etc) with filename that not exist yet, Notepad.exe shows the dialog "File does not exist. Do you want to create it?"
Is it possible that adding this feature to Notepads.exe?

image

Describe alternatives you've considered

image

Implemented in #383.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants