Highlighted

File - File on network location

Community Beginner ,
Jun 18, 2015

Copy link to clipboard

Copied

Hello,

On many occasions I have had to make a benchmark of my files and this time I must comparing the files that I have on a PC with which I have stored on a Mac; at this point a question arises:

How to declare the File variable when it is in a network location?

To do this, I need do solve this checklist:

  1. I have access to the machine in the local network (username, password, stored credentials)
  2. I know the path that points to the drive or directory that you want access.

With this elements covered, I must declare the File variable, with the following notation:

var macStr:String = "file:////MacBook-Pro-de-Jaime.local/Seagate/netShared/transport-machines/SoftDepot";

var windStr:String = "file:///U:/Appliances/Libraries/SoftDepot";

var macStorage:File = new File (macStr);

var pcStorage:File = new File (windStr);

And presto, I was unable to access a network location to make my benchmark.

Note that in the chains of the native path to the network location (macStr) the file descriptor is accompanied by four slash (file:////), while in the conventional notation file system has only file descriptor 3 slash (file:///)

I hope someone will be useful this TIP.

TOPICS
Development

Views

143

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

File - File on network location

Community Beginner ,
Jun 18, 2015

Copy link to clipboard

Copied

Hello,

On many occasions I have had to make a benchmark of my files and this time I must comparing the files that I have on a PC with which I have stored on a Mac; at this point a question arises:

How to declare the File variable when it is in a network location?

To do this, I need do solve this checklist:

  1. I have access to the machine in the local network (username, password, stored credentials)
  2. I know the path that points to the drive or directory that you want access.

With this elements covered, I must declare the File variable, with the following notation:

var macStr:String = "file:////MacBook-Pro-de-Jaime.local/Seagate/netShared/transport-machines/SoftDepot";

var windStr:String = "file:///U:/Appliances/Libraries/SoftDepot";

var macStorage:File = new File (macStr);

var pcStorage:File = new File (windStr);

And presto, I was unable to access a network location to make my benchmark.

Note that in the chains of the native path to the network location (macStr) the file descriptor is accompanied by four slash (file:////), while in the conventional notation file system has only file descriptor 3 slash (file:///)

I hope someone will be useful this TIP.

TOPICS
Development

Views

144

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 18, 2015 0

Have something to add?

Join the conversation