File editing via shared folder, bug?

Joined
Jan 18, 2012
Messages
2
Reaction score
0
Points
1
I have file sharing enabled from Mac to PC. When I edit a file on the PC (from the Mac's shared folder), and then save the file, the text is messed up on the Mac. This doesn't happen when I move a file to Mac via USB.

FOR EXAMPLE:
I create a file "abc.txt" on Mac. It contains the following text:

abc
123
asd
456

I then put it in the shared folder.

I then go to the PC and open it (via shared folder). I remove "asd" so it looks like this:

abc
123
456

I save it and go back to Mac.

On Mac, it looks like this:

abc
123
456
456

So not only does Mac remove "asd", it also repeats the last line.

I'm stumped..
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
What are you using to edit the file on either the Mac or the PC? When it comes to text DOS type programs put a cr/lf at the end of line - whereas *NIX does something different.
How to Transfer Text Files Between Linux, Macintosh, Microsoft Windows Operating Systems
Vim is available across platforms and handles various text files well.

There is also a command called dos2unix that helps fix these kinds of issues. You can get it from macports or fink - I don't think it comes by default on the Mac because my install is in /opt/local/bin - which usually means a macport install.
The MacPorts Project -- Home
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
What are you using to edit the file on either the Mac or the PC? When it comes to text DOS type programs put a cr/lf at the end of line - whereas *NIX does something different.
I know the operating systems represent line and carriage returns differently but would this cause the last line to repeat?
 
OP
G
Joined
Jan 18, 2012
Messages
2
Reaction score
0
Points
1
What are you using to edit the file on either the Mac or the PC? When it comes to text DOS type programs put a cr/lf at the end of line - whereas *NIX does something different.
How to Transfer Text Files Between Linux, Macintosh, Microsoft Windows Operating Systems
Vim is available across platforms and handles various text files well.

There is also a command called dos2unix that helps fix these kinds of issues. You can get it from macports or fink - I don't think it comes by default on the Mac because my install is in /opt/local/bin - which usually means a macport install.
The MacPorts Project -- Home

I'm using Notepad++ on PC and Xcode / TextEdit / TextWrangler on Mac; all three of which produce the same bug.

Thanks for your feedback, I'll work on it and post my results afterwards.

One thing to note is this also happens over multiple lines. I deleted a large chunk of HTML from another file. It deleted the same chunk on Mac, but it also replicated the same number of lines from the bottom of the code and then added those lines to the bottom of the code.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top