[CentOS] OT? File order on CentOS/Samba server

Les Mikesell lesmikesell at gmail.com
Thu Jan 22 21:31:54 UTC 2009

Miguel Medalha wrote:
> I hope someone familiar with the way Linux processes files can enlighten 
> me on the following:
> I recently replaced an old Windows 2000 server with a new machine 
> running CentOS 5.2. It uses Samba 3.2.7 to serve a network of Windows XP 
> clients.
> We are a newspaper. We use Acrobat Distiller to batch-convert a folder 
> of single-page PostScript files (for print) to a multipage PDF file (for 
> electronic distribution).
> Running on a workstation, Distiller watches the folder on a Samba share 
> and does the conversion, automatically creating bookmarks, indexes and 
> other information.
> On the Windows server, Distiller processes the files by filename order:
> M09010901A001C.ps
> M09010901A002C.ps
> M09010901A003C.ps
> ... and so on.
> On the Linux server, Distiller processes the files in an order that 
> seems arbitrary, for example:
> M09010901A021C.ps
> M09010901A005C.ps
> M09010901A015C.ps
> ... and so on.
> The order Distiller uses is NOT related to the time stamp of the files. 
> I tried to copy the files to the watched folder one by one in the 
> correct order; the result is the same.

Programs that read directories on their own normally find files in the 
order that they happen to appear in the directory.  In a newly created 
directory, that would likely be in the order that the files were added, 
but in existing directories, slots previously used and now free may be 
reused in any order and this may not be consistent across filesystem 
types. If you are processing on the linux side and not via samba, and 
your program will take a list of files on the command line instead of 
groveling through the directory itself, you might simply start it with a 
wild-card filename on the command line.  The shell will sort the list as 
it expands it so programs see the sorted list.

> There is a workaround to this: use the runfilex script that comes with 
> Acrobat: it can contain a list of files to convert, in the order you 
> want. Unfortunately, this is not acceptable for us since the process 
> then takes about 40 minutes (irrespective of platform or filesystem), 
> instead of 3 or 4 minutes.

That's very strange.  Maybe you should look for a different tool.  Won't 
ghostscript/psutils or OOo do this?

   Les Mikesell
     lesmikesell at gmail.com

More information about the CentOS mailing list