Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is default directory of File.Open?

I have this code:

Stream f = File.Open("data.majid", FileMode.OpenOrCreate, FileAccess.ReadWrite);

Where will be file created?

like image 874
Majid Avatar asked Apr 14 '13 15:04

Majid


People also ask

What is the default directory?

A default folder is a folder that is used for various applications if the user does not specify a different folder.

Where is the default directory?

Excel, by default, saves all files in the folder: C:\Users\*username*\Documents. To change this, in the Ribbon, go to File > Options. 1.

How do I change the default file open location?

Open Excel and navigate to the File menu. Click on Options, then Advanced. Scroll down until you see General. Locate the line that says “At startup, open all files in:” Enter the path to an existing folder that you want to use as your default when opening files in Excel.

Where is Open file location?

Right-click the “Start” menu shortcut for the application, and select More > Open file location. This will open a File Explorer window that points to the actual application shortcut file.


3 Answers

From the File.Open MSDN documentation:

The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory.

like image 78
Matt Ball Avatar answered Oct 03 '22 13:10

Matt Ball


Usually the directory where the process was started from. This is the current working directory.

From MSDN

The current directory is distinct from the original directory, which is the one from which the process was started.

like image 29
bash.d Avatar answered Oct 01 '22 13:10

bash.d


From MSDN;

The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory.

Check out Directory.GetCurrentDirectory

The current directory is distinct from the original directory, which is the one from which the process was started.

like image 29
Soner Gönül Avatar answered Sep 29 '22 13:09

Soner Gönül