The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Networking (http://hintsforums.macworld.com/forumdisplay.php?f=14)
-   -   Slow Ethernet connection in mixed Network (http://hintsforums.macworld.com/showthread.php?t=32877)

hayne 01-05-2005 05:54 PM

Quote:

Originally Posted by sirius
I ran the pearl script and got the following error messages:

Use of uninitialized value in concatenation (.) or string at ./myscript1 line 31.
Use of uninitialized value in concatenation (.) or string at ./myscript1 line 31.
can't open file for reading: No such file or directory at ./myscript1 line 31.

Well, in my copy of the Perl script, line 31 is the one that starts with
open(SRC, "<$file_to_copy")

and so (assuming that is line 32 in your copy as well), the problem is exactly what Raven had encountered and reported a few posts above.
I.e. it seems likely that you aren't supplying the source filename and destination filename as command-line arguments when you run it.
Your invocation line should look like:

./name_of_script /path/to/source_file /path/to/destination_file

(It copies the source file to the destination file)

For example:

./name_of_script /Users/your_username/Movies/name_of_movie.mov /tmp/foo

sirius 01-08-2005 04:39 PM

I cannot get it done due to lack of experience with UNIX and Terminal. I inserted the following line as advised by hayne:

open(SRC, "<$file_to_copy")
.myscript1 /Users/lutznetz/Movies/Test.avi /Users/lutznetz/Public/Test.avi
|| die "can't open file $file_to_copy for reading: $!";
open(DEST, ">$destination")
|| die "can't open file $destination for writing: $!";



And I am getting the following output when I run the Script:

Bareword "myscript1" not allowed while "strict subs" in use at ./myscript1 line 31.
Bareword "Users" not allowed while "strict subs" in use at ./myscript1 line 31.
Bareword "lutznetz" not allowed while "strict subs" in use at ./myscript1 line 31.
Bareword "Movies" not allowed while "strict subs" in use at ./myscript1 line 31.
Bareword "Test" not allowed while "strict subs" in use at ./myscript1 line 31.
Bareword "avi" not allowed while "strict subs" in use at ./myscript1 line 31.
Bareword "Users" not allowed while "strict subs" in use at ./myscript1 line 31.
Bareword "lutznetz" not allowed while "strict subs" in use at ./myscript1 line 31.
Bareword "Public" not allowed while "strict subs" in use at ./myscript1 line 31.
Bareword "Test" not allowed while "strict subs" in use at ./myscript1 line 31.
Bareword "avi" not allowed while "strict subs" in use at ./myscript1 line 31.
Execution of ./myscript1 aborted due to compilation errors.


How can I copy one file from my Mac to the XP machin? What arguments to put into the command line?

hayne 01-09-2005 01:11 AM

Quote:

Originally Posted by sirius
I inserted the following line as advised by hayne:

open(SRC, "<$file_to_copy")
.myscript1 /Users/lutznetz/Movies/Test.avi /Users/lutznetz/Public/Test.avi
|| die "can't open file $file_to_copy for reading: $!";

Sorry, you seem to have misunderstood me - I did not advise adding in a line to the script. I was talking about how you would run the script.
Please remove the line that you added to the script - i.e. restore it to the way it was originally.

I'm assuming from what you have said above that you have saved the script in a file named "myscript1".
And I assume that there is an existing file named "Test.avi" in the "Movies" folder in your home folder.

If those assumptions are correct, then you could run the script to copy that .avi file to the "Public" folder by typing in the following command line in a Terminal window (not in the pico editor, just in a new Terminal window):
Code:

./myscript /Users/lutznetz/Movies/Test.avi /Users/lutznetz/Public/Test.avi

To try the script again, this time in copying that same file to a disk drive on your Windows machine, you need to know the name of the remote disk drive as it appears in your Finder window. Let's suppose that your Windows share is called "Fred" (i.e. in the Finder window it shows a remote drive named "Fred"), then in the Terminal, that drive is at the path "/Volumes/Fred" and so you could copy the .avi file to the toplevel of your "Fred" drive
with the following command (in a Terminal window):
Code:

./myscript /Users/lutznetz/Movies/Test.avi /Volumes/Fred/Test.avi

sirius 01-09-2005 12:21 PM

Hayne,
thanks for your help. I am slowly getting there and learned a lot about case sensitivity and basic UNIX Commands in the Terminal window. I feel like working with DOS 3 again!

Now the first step went finally well. With the Command line input:

:~ lutznetz$ ./myscript1 /Users/lutznetz/Movies/Test.avi /Users/lutznetz/Public/Test.avi

I got a long list of transfer protocol ending with:

12.92 s: 143327232 bytes (read:37491.0 KB/s write:71278.7 KB/s copy:24568.5 KB/s)
12.95 s: 143392768 bytes (read:38027.4 KB/s write:2684.3 KB/s copy:2507.3 KB/s)
12.95 s: 143457770 bytes (read:33947.2 KB/s write:73205.4 KB/s copy:23192.4 KB/s)
13.08 s: files are closed
Average transfer rate: 10707.4 KB/s

The transer rate sounds good for a 135MB file.

Then I tried to do the same transfer to the XP Machine.
I connected the MAC to the XP Computer by "Connect to server" and selected my sons Computer SMB://Home;1000mhz from the list.
"Home" is the Workgroup, "1000mhz" is the Computer name. Then i selected SHAREDDOCS from the list of shared folders on my sons Computer. In the Finder window, SHAREDDOCS pops up and I can read and write within the folder. Then I ran the script again in Terminal as advised and got the following output.

:~ lutznetz$ ./myscript1 /Users/lutznetz/Movies/Test.avi /Volumes/SHAREDDOCS/Test.avi
can't open file /Volumes/SHAREDDOCS/Test.avi for writing: No such file or directory at ./myscript1 line 34.

I navigated myself on Terminal to Volumes, this is the output, when I typed "ls":

Lutz-Computer:/Volumes lutznetz$ ls
Daten Home;1000mhz Ohne Titel 1

Then I typed: cd Home;1000mhz
and got:

Lutz-Computer:/Volumes lutznetz$ cd Home;1000mhz
-bash: cd: Home: No such file or directory
-bash: 1000mhz: command not found

"Daten" and "Ohne Titel 1" are partitions on the Mac. I can see the content of those partitions with "cd Daten" and "ls"

Conclusion from my side, the Computer is visible but not acessible in Terminal although visible and acessible in Finder. ??????

hayne 01-09-2005 01:30 PM

Quote:

Originally Posted by sirius
Lutz-Computer:/Volumes lutznetz$ ls
Daten Home;1000mhz Ohne Titel 1

I'm a bit surprised that the share shows up in Finder as "SHAREDDOCS" while in Terminal it shows up as "Home;1000mhz".

Quote:

Then I typed: cd Home;1000mhz
The ";" is a character that is special to the Unix shell - it is used to indicate the end of a command. That is why you got those error messages about Home not being found, etc.
When you have unusual characters within a filename, you need to enclose the filename within quotes. Note that even spaces are considered unusual characters for Unix filenames since spaces are used as separators between command words in the Unix shell. So here, to navigate to that volume, you need to do:

cd "Home;1000mhz"

The problem with the Perl script is now clear - the destination path you gave it did not correspond to the path as seen in Terminal.
Try it again like this:

./myscript1 /Users/lutznetz/Movies/Test.avi "/Volumes/Home;1000mhz/Test.avi"

where I have used the correct name of the volume and have enclosed the destination path in quotes to protect the unusual character (;) in the volume name.

sirius 01-09-2005 05:39 PM

Hayne,
it worked. Please see the output. It starts with:

Lutz-Computer:~ lutznetz$ ./myscript1 /Users/lutznetz/Movies/Test.avi "/Volumes/Home;1000mhz/Test.avi"
0.00 s: files are open
0.02 s: 65536 bytes (read:10700.6 KB/s write:4319.1 KB/s copy:3077.1 KB/s)
0.04 s: 131072 bytes (read:34388.3 KB/s write:4418.7 KB/s copy:3915.6 KB/s)
0.07 s: 196608 bytes (read:39750.5 KB/s write:1856.1 KB/s copy:1773.3 KB/s)
1.48 s: 262144 bytes (read:37962.9 KB/s write:45.6 KB/s copy:45.5 KB/s)
2.98 s: 327680 bytes (read:37754.6 KB/s write:42.8 KB/s copy:42.7 KB/s)
2.99 s: 393216 bytes (read:37184.6 KB/s write:4684.9 KB/s copy:4160.7 KB/s)
4.49 s: 458752 bytes (read:40530.8 KB/s write:42.9 KB/s copy:42.8 KB/s)
8.98 s: 524288 bytes (read:38119.2 KB/s write:14.3 KB/s copy:14.3 KB/s)
8.99 s: 589824 bytes (read:37015.4 KB/s write:4730.2 KB/s copy:4194.2 KB/s)
9.01 s: 655360 bytes (read:38668.3 KB/s write:4633.0 KB/s copy:4137.3 KB/s)
9.04 s: 720896 bytes (read:40561.4 KB/s write:1900.2 KB/s copy:1815.2 KB/s)
9.06 s: 786432 bytes (read:36949.1 KB/s write:4507.7 KB/s copy:4017.5 KB/s)
10.60 s: 851968 bytes (read:40378.4 KB/s write:41.4 KB/s copy:41.4 KB/s)
10.62 s: 917504 bytes (read:38070.6 KB/s write:4642.8 KB/s copy:4138.1 KB/s)
11.98 s: 983040 bytes (read:39452.6 KB/s write:47.1 KB/s copy:47.1 KB/s)
12.00 s: 1048576 bytes (read:37538.2 KB/s write:2939.4 KB/s copy:2726.0 KB/s)
16.48 s: 1114112 bytes (read:39337.0 KB/s write:14.3 KB/s copy:14.3 KB/s)
16.49 s: 1179648 bytes (read:37538.2 KB/s write:4293.2 KB/s copy:3852.6 KB/s)
16.51 s: 1245184 bytes (read:40354.1 KB/s write:4245.4 KB/s copy:3841.3 KB/s)
16.55 s: 1310720 bytes (read:39874.5 KB/s write:1854.4 KB/s copy:1772.0 KB/s)
17.99 s: 1376256 bytes (read:33897.6 KB/s write:44.5 KB/s copy:44.4 KB/s)
18.00 s: 1441792 bytes (read:36888.2 KB/s write:4663.7 KB/s copy:4140.3 KB/s)
18.02 s: 1507328 bytes (read:40299.6 KB/s write:4175.6 KB/s copy:3783.6 KB/s)
22.48 s: 1572864 bytes (read:40023.2 KB/s write:14.4 KB/s copy:14.4 KB/s)
22.49 s: 1638400 bytes (read:38162.6 KB/s write:4515.6 KB/s copy:4037.8 KB/s)
23.98 s: 1703936 bytes (read:39750.5 KB/s write:42.9 KB/s copy:42.9 KB/s)
24.00 s: 1769472 bytes (read:38119.2 KB/s write:4430.9 KB/s copy:3969.5 KB/s)
24.02 s: 1835008 bytes (read:38298.7 KB/s write:3991.5 KB/s copy:3614.8 KB/s)
25.48 s: 1900544 bytes (read:40281.4 KB/s write:43.7 KB/s copy:43.6 KB/s)
25.50 s: 1966080 bytes (read:37627.6 KB/s write:4416.8 KB/s copy:3952.8 KB/s)
25.52 s: 2031616 bytes (read:40251.2 KB/s write:4594.1 KB/s copy:4123.4 KB/s)
25.53 s: 2097152 bytes (read:39756.4 KB/s write:4462.4 KB/s copy:4012.1 KB/s)
25.57 s: 2162688 bytes (read:2912.8 KB/s write:4443.8 KB/s copy:1759.5 KB/s)
25.58 s: 2228224 bytes (read:37962.9 KB/s write:4647.4 KB/s copy:4140.5 KB/s)
27.16 s: 2293760 bytes (read:40354.1 KB/s write:40.7 KB/s copy:40.7 KB/s)
28.49 s: 2359296 bytes (read:34423.6 KB/s write:48.2 KB/s copy:48.1 KB/s)
31.48 s: 2424832 bytes (read:37936.0 KB/s write:21.4 KB/s copy:21.4 KB/s)
31.50 s: 2490368 bytes (read:35516.7 KB/s write:4450.6 KB/s copy:3955.0 KB/s)
31.51 s: 2555904 bytes (read:37381.3 KB/s write:4537.4 KB/s copy:4046.3 KB/s)
32.99 s: 2621440 bytes (read:36591.5 KB/s write:43.5 KB/s copy:43.5 KB/s)
33.00 s: 2686976 bytes (read:38054.4 KB/s write:4360.3 KB/s copy:3912.0 KB/s)
33.02 s: 2752512 bytes (read:39874.5 KB/s write:4201.1 KB/s copy:3800.7 KB/s)
33.05 s: 2818048 bytes (read:40378.4 KB/s write:1860.3 KB/s copy:1778.4 KB/s)
33.07 s: 2883584 bytes (read:35696.2 KB/s write:4542.5 KB/s copy:4029.7 KB/s)
33.09 s: 2949120 bytes (read:39096.3 KB/s write:4277.2 KB/s copy:3855.4 KB/s)
34.49 s: 3014656 bytes (read:39999.3 KB/s write:45.8 KB/s copy:45.7 KB/s)
34.50 s: 3080192 bytes (read:38070.6 KB/s write:4818.5 KB/s copy:4277.2 KB/s)
34.52 s: 3145728 bytes (read:35915.9 KB/s write:4612.0 KB/s copy:4087.1 KB/s)
35.99 s: 3211264 bytes (read:38298.7 KB/s write:43.6 KB/s copy:43.6 KB/s)
36.00 s: 3276800 bytes (read:37957.5 KB/s write:4543.2 KB/s copy:4057.6 KB/s)
37.49 s: 3342336 bytes (read:40457.5 KB/s write:43.1 KB/s copy:43.1 KB/s)
37.50 s: 3407872 bytes (read:37936.0 KB/s write:4610.9 KB/s copy:4111.2 KB/s)
38.98 s: 3473408 bytes (read:40457.5 KB/s write:43.3 KB/s copy:43.3 KB/s)
39.00 s: 3538944 bytes (read:37580.2 KB/s write:4591.1 KB/s copy:4091.3 KB/s)
39.01 s: 3604480 bytes (read:40506.3 KB/s write:4657.3 KB/s copy:4177.0 KB/s)
39.03 s: 3670016 bytes (read:40077.0 KB/s write:4232.2 KB/s copy:3828.0 KB/s)
39.07 s: 3735552 bytes (read:2900.4 KB/s write:4186.6 KB/s copy:1713.4 KB/s)
40.48 s: 3801088 bytes (read:37231.0 KB/s write:45.2 KB/s copy:45.1 KB/s)
40.50 s: 3866624 bytes (read:37733.4 KB/s write:4173.2 KB/s copy:3757.6 KB/s)
43.48 s: 3932160 bytes (read:39481.6 KB/s write:21.5 KB/s copy:21.5 KB/s)
43.50 s: 3997696 bytes (read:35181.6 KB/s write:4539.4 KB/s copy:4020.6 KB/s)


and goes on...
This is the middle part:


762.56 s: 54394880 bytes (read:35126.3 KB/s write:4099.7 KB/s copy:3671.2 KB/s)
762.58 s: 54460416 bytes (read:39850.9 KB/s write:4599.0 KB/s copy:4123.2 KB/s)
762.61 s: 54525952 bytes (read:35320.5 KB/s write:2049.5 KB/s copy:1937.1 KB/s)
764.04 s: 54591488 bytes (read:35218.5 KB/s write:44.8 KB/s copy:44.7 KB/s)
765.54 s: 54657024 bytes (read:37914.6 KB/s write:42.8 KB/s copy:42.7 KB/s)
767.04 s: 54722560 bytes (read:37035.8 KB/s write:42.6 KB/s copy:42.6 KB/s)
770.04 s: 54788096 bytes (read:38097.6 KB/s write:21.3 KB/s copy:21.3 KB/s)
770.06 s: 54853632 bytes (read:37738.7 KB/s write:4326.6 KB/s copy:3881.6 KB/s)
771.55 s: 54919168 bytes (read:40378.4 KB/s write:43.1 KB/s copy:43.0 KB/s)
773.05 s: 54984704 bytes (read:36721.7 KB/s write:42.6 KB/s copy:42.6 KB/s)
776.57 s: 55050240 bytes (read:37850.5 KB/s write:18.2 KB/s copy:18.2 KB/s)
778.04 s: 55115776 bytes (read:38298.7 KB/s write:43.4 KB/s copy:43.3 KB/s)
787.54 s: 55181312 bytes (read:37914.6 KB/s write:6.7 KB/s copy:6.7 KB/s)
801.04 s: 55246848 bytes (read:38119.2 KB/s write:4.7 KB/s copy:4.7 KB/s)
810.54 s: 55312384 bytes (read:36157.8 KB/s write:6.7 KB/s copy:6.7 KB/s)
823.04 s: 55377920 bytes (read:38184.3 KB/s write:5.1 KB/s copy:5.1 KB/s)
832.04 s: 55443456 bytes (read:36908.5 KB/s write:7.1 KB/s copy:7.1 KB/s)
846.07 s: 55508992 bytes (read:38189.7 KB/s write:4.6 KB/s copy:4.6 KB/s)
860.54 s: 55574528 bytes (read:37914.6 KB/s write:4.4 KB/s copy:4.4 KB/s)
863.55 s: 55640064 bytes (read:37184.6 KB/s write:21.3 KB/s copy:21.3 KB/s)
866.55 s: 55705600 bytes (read:35535.5 KB/s write:21.3 KB/s copy:21.3 KB/s)
871.05 s: 55771136 bytes (read:34610.0 KB/s write:14.2 KB/s copy:14.2 KB/s)
881.55 s: 55836672 bytes (read:37957.5 KB/s write:6.1 KB/s copy:6.1 KB/s)
895.55 s: 55902208 bytes (read:38184.3 KB/s write:4.6 KB/s copy:4.6 KB/s)
912.55 s: 55967744 bytes (read:397.5 KB/s write:3.8 KB/s copy:3.8 KB/s)
922.55 s: 56033280 bytes (read:10820.1 KB/s write:6.4 KB/s copy:6.4 KB/s)
928.55 s: 56098816 bytes (read:38119.2 KB/s write:10.7 KB/s copy:10.7 KB/s)
931.56 s: 56164352 bytes (read:37845.1 KB/s write:21.3 KB/s copy:21.3 KB/s)
937.56 s: 56229888 bytes (read:38168.0 KB/s write:10.7 KB/s copy:10.7 KB/s)
940.55 s: 56295424 bytes (read:33613.3 KB/s write:21.4 KB/s copy:21.4 KB/s)
949.59 s: 56360960 bytes (read:38276.8 KB/s write:7.1 KB/s copy:7.1 KB/s)

after 950s I killed it. At that time 53 MB had benn transfered to the XP shared folder. You see, at the end it is getting slower and slower. I am in Europe next week. I wlii follow up, because I am really interested what might cause this effect.

Thanks

hayne 01-11-2005 06:41 PM

Some more diagnostic tools that might prove useful are listed in this post from an old thread on a similar topic:
http://forums.macosxhints.com/showpo...2&postcount=32

I finally got around to trying 'iperf'.
I downloaded the source code (from the page listed in the post referred to above) and compiled it with 'make'.
I also did this on a Linux machine on our network.
Then I ran the command:
iperf -s
on the Linux machine. (This makes it act as a server, listening for 'iperf' requests.)
And I ran the command:
iperf -c xxx.xxx.xxx.xxx
on my Mac (where xxx.xxx.xxx.xxx represents the IP address of the Linux machine )
and it gave me basic statistics on transfer rate.
Read the documentation page on the developer's site to learn how to give it other options to get more detailed info.

Note that there are pre-compiled binary executables available for most platforms, including Windows, so you don't have to compile it from source.


All times are GMT -5. The time now is 09:37 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.