Martin Atkins (mart) wrote in fotobilder,
Martin Atkins

make_dirs on Windows

I tracked down the source of the uploading problems csogilvie was having. The problem is that make_dirs assumes that all paths begin with slashes, which isn't true on Windows.

The function therefore tries to (with my configuration at least) create the directory /d:, which maps to C:\D:. Since colons are not allowed in file and directory names for Windows filesystems, the mkdir() call fails.

I'm not sure what to suggest, however. Since /d:/fotobilder is a perfectly valid path (even if it is a little silly) on a UNIX system, it can't just check to see if the first bit looks vaugely like a Windows drive letter. I can take the drive letter out of my $PIC_ROOT, but then it'll create on C: which is where my Apache install lives, and while I have my D: drive mapped to a directory on my C: drive, that's not true for many people and so shouldn't be relied on.

I have no solution to offer: I merely present the problem.

Update: If you set FBHOME (or just $PIC_ROOT) to a path which does not begin with a driver letter but instead is relative to the root of drive Apache runs from, it can work with one minor modification which should not break UNIX. In make_dirs, just after the start of the foreach loop, add the statment next unless $_;. If you don't add this, the code will try to create a directory called /fotobilder (or whatever it's called) in the root directory — that is, a directory name with a slash in it, whose path is //fotobilder — and fail because a directory name cannot contain a slash. This new conditional at the start of the loop makes the code skip out 'empty' directory names, which aren't valid on UNIX either but the mkdir function there cheats and ignores them.


  • 302: lj_dev

    In the interests of consolidating all FotoBilder development-related discussion, we're going to be closing down this community. The same…

  • Development stalled?

    Is the development of Fotobilder held? Stalled? I am asking because there is no activity on the community and there is no link to the Fotobilder…

  • (no subject)

    Does FotoBilder works with Apache2? I installed all the required modules on my debian sarge, and when I restart my apache server, it dies horribly…

  • Post a new comment


    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic