Skip to main content
jaimeMéndez10285094
Participant
June 19, 2015
Question

File - File on network location

  • June 19, 2015
  • 0 replies
  • 221 views

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.

This topic has been closed for replies.