More details.

The write-only procedure was using -[NSString 
writeToURL:atomically:encoding:error:], with atomically set to YES. 

I noticed that the app did file-move and rename operations on, to and between 
SMB volumes without problems, so I changed the write process to create the file 
locally on the Mac and use NSFileManager to [ moveItemAtURL:toURL:error:]  the 
item to the remote SMB volume. This works flawlessly.

But this does not identify the actual source of the problem. -[NSString 
writeToURL:atomically:encoding:error:] should work correctly. (Or perhaps I 
need to wrap it in some additional housekeeping?)
However I cannot easily assert that this is a Foundation problem even though 
the code has worked correctly for years on older Windows Server shares. 

I am not any kind of expert on Windows networking, and have no insight as to 
why creating a file on a Windows share should be different than copying a file 
to the same share.

I would still welcome any wisdom on this, at least to provide a reference for 
befuddled future readers.

> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Fri, 28 Apr 2017 15:21:45 -0500
> From: Kirk <kirkkere...@gmail.com>
> To: cocoa-dev@lists.apple.com
> Subject: Mysterious write-only SMB behavior
> Message-ID: <8be95449-f93e-4847-ae39-4f45f63c5...@gmail.com>
> Content-Type: text/plain;     charset=us-ascii
> 
> I have Cocoa application that does a specialized task for my employer. It 
> runs on a Mini running Sierra but all file I/O is from/to network SMB volumes 
> shared by Windows Server over the company network.
> 
> The Mini is a full admin domain member, both computer and user. 
> 
> This application has been working fine, until we recently upgraded the server 
> from WS 2008 to 2016 and moved a lot of stuff around. 
> 
> Now, files that my app creates over SMB are invisible to Macs, but visible to 
> Windows clients. And then if that were not odd enough, the files become 
> visible to a Mac if they are found by a Finder file-name search on the SMB 
> volume. Once the search is closed, the files resume being invisible. 
> 
> All of the files are text files, with various non-standard file extensions 
> for housekeeping purposes. 
> 
> FIles that my app merely modifies (renames) and relocates remain visible, and 
> directories that it creates are visible. 
> 
> If this rings a bell with anyone, I would appreciate a clue, which would be 
> one more than I have now. 
> 
> Kirk Kerekes 
> (iPhone)
> 

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to