aspose file tools*
The moose likes Mac OS and the fly likes Unix command wiredness in OS 10.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Neo4J in Action this week in the Neo4J forum!
JavaRanch » Java Forums » Engineering » Mac OS
Bookmark "Unix command wiredness in OS 10.3" Watch "Unix command wiredness in OS 10.3" New topic
Author

Unix command wiredness in OS 10.3

Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
OK, I know this is not a Java question. But in case some of you happen to know ...
I know that the Unix file commands ignore resource forks on the OS X system. I have found that the Unix CP command makes corrupted copies of my large QuickTime .mov files. So, I have learned to copy files with CpMac or use the finder. That is all good.
However, I was trying to get some large files to a windows machine via the OSX's build-in FTP server tonight. It seems that the Mac FTP server uses the Unix "ls" and "cp" to serve the FTP requests. That resulted in corrupted files on the FTP client end.
Any thoughts how I might fix that? Thanks a lot.


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
norman richards
Author
Ranch Hand

Joined: Jul 21, 2003
Posts: 367
I didn't know quicktime used resource forks. Quicktimes get transfered all over the net all the time. You might check your export options on quicktime to make sure you are exporting normally. If you really had forks you wouldn't be able to view the movie on anything but a mac.
Beyond that, a dmg or sit file would definitely capture the information you need. You can create a disk image with the disk tool. (look in /Applications/Utilities I think) I'm not sure if the version of stuffit that comes with OS X will create .sit archives, but you could also try that. I'm not a fan of that format, but it's another option...
Loren Rosen
Ranch Hand

Joined: Feb 12, 2003
Posts: 156
Another thing to check is that the files are being transferred as 'binary', not the default 'text'. That's by far the biggest cause of corrupted ftp transfers, going way back to even before the first Mac existed.
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
I did use "binary" in FTP transfer ...
Ok, quicktime does not depend on resource forks, but Unix "cp" definately corrupts large files. Say if I have a 700MB QuickTime file "mymovie.mov". If I do

Quicktime will return an error that file is not "QT format". If I do

it works fine.
It also works fine if I make a copy "tmp3.mov" from the finder itself.
Now. when I use the Unix "ls -al" command to see those files, all of them have the exact same size. But in finder, the three "tmpX.mov" files have three different size. "tmp1.mov" reports the same size from the Unix "ls" and the finder, but it is corrupted.
Is this a new bug in panther?
[ November 14, 2003: Message edited by: Michael Yuan ]
Loren Rosen
Ranch Hand

Joined: Feb 12, 2003
Posts: 156
It's unlikely that ftp directly uses ls and cp. More likely it uses the same underlying Unix system calls. Anyway, I'd try creating some other large files (e.g., via 'tar', or iterative use of 'cat'), and trying different file systems (HFS, HFS+, etc.) to see if there's some pattern.
I did try using cp on a downloaded quicktime movie on my system (still running 10.1), and the copy and the original were identical. The file was only a dozen or so megabytes, though.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unix command wiredness in OS 10.3